Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multithreading in CVF 6.6

Status
Not open for further replies.

desmo3re

Programmer
Nov 8, 2007
1
IT
Hi to all!
This is my first message.
I have a code like this:
SUBROUTINE MyProc (counter)
USE DFMT
!DEC$ ATTRIBUTES VALUE :: counter
integer*4 counter
! Subroutine work goes here.
Call exitthread(0) ! Exit code is 0.
END

SUBROUTINE other (arg1,arg2)
USE DFMT
integer*4 ind_thread

ind_thread=LOC(MyProc)
hThread1 = CreateThread (0, 0,ind_thread,LOC(arg),0,LOC(thread_id))
...
END

I'm trying to use CreateThread function to launch a subroutine of my program in another thread, but the compiler gives an error in the CreateThread function.
The error says this way:"Error: This actual argument must be the name of a procedure and not a data object. [IND_THREAD]"
I tryed to put "MyProc" instead of ind_thread in the 3rd parameter of CreateThread but the error still remains.
Am I wrong in using LOC function? Do you think I have to add some "USE" statements?
Thank you all in advice!
 
Just a guess. Try this
Code:
SUBROUTINE other (arg1,arg2)
    USE DFMT
    [COLOR=red]use subroutine MyProc (counter)[/color]
    integer*4 ind_thread
    ind_thread=LOC(MyProc)
    hThread1 = CreateThread (0, 0,ind_thread,LOC(arg),0,LOC(thread_id))
...
END
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top