git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/map65@1755 ab8295b8-cf94-4d9e-aec4-7959e3be5d79

This commit is contained in:
Joe Taylor 2010-01-15 16:36:13 +00:00
parent 7a170e04d9
commit 4f6e3d73e2
4 changed files with 23 additions and 12 deletions

View File

@ -1,4 +1,4 @@
#-------------------------------------------------------------------- MAP65 #--------------------------------------------------------------------- MAP65
# $Date$ $Revision$ # $Date$ $Revision$
# #
from Tkinter import * from Tkinter import *

View File

@ -19,7 +19,10 @@ subroutine recvpkt(iarg)
data multicast0/-99/ data multicast0/-99/
save save
1 call setup_rsocket(multicast) !Open socket for multicast/unicast data 1 continue
call cs_lock('recvpkt')
call setup_rsocket(multicast) !Open socket for multicast/unicast data
call cs_unlock
k=0 k=0
kk=0 kk=0
kxp=0 kxp=0

View File

@ -2,8 +2,9 @@ subroutine cs_init
use dfmt use dfmt
type (RTL_CRITICAL_SECTION) ncrit1 type (RTL_CRITICAL_SECTION) ncrit1
character*12 csub0 character*12 csub0
common/mtxcom/ltrace,mtx,mtxstate,csub0 integer*8 mtx
ltrace=1 common/mtxcom/mtx,ltrace,mtxstate,csub0
ltrace=0
mtx=loc(ncrit1) mtx=loc(ncrit1)
mtxstate=0 mtxstate=0
csub0='**unlocked**' csub0='**unlocked**'
@ -15,7 +16,8 @@ subroutine cs_destroy
use dfmt use dfmt
type (RTL_CRITICAL_SECTION) ncrit1 type (RTL_CRITICAL_SECTION) ncrit1
character*12 csub0 character*12 csub0
common/mtxcom/ltrace,mtx,mtxstate,csub0 integer*8 mtx
common/mtxcom/mtx,ltrace,mtxstate,csub0
call DeleteCriticalSection(mtx) call DeleteCriticalSection(mtx)
return return
end subroutine cs_destroy end subroutine cs_destroy
@ -38,7 +40,8 @@ subroutine cs_lock(csub)
use dfmt use dfmt
character*(*) csub character*(*) csub
character*12 csub0 character*12 csub0
common/mtxcom/ltrace,mtx,mtxstate,csub0 integer*8 mtx
common/mtxcom/mtx,ltrace,mtxstate,csub0
n=TryEnterCriticalSection(mtx) n=TryEnterCriticalSection(mtx)
if(n.eq.0) then if(n.eq.0) then
! Another thread has already locked the mutex ! Another thread has already locked the mutex
@ -56,7 +59,8 @@ end subroutine cs_lock
subroutine cs_unlock subroutine cs_unlock
use dfmt use dfmt
character*12 csub0 character*12 csub0
common/mtxcom/ltrace,mtx,mtxstate,csub0 integer*8 mtx
common/mtxcom/mtx,ltrace,mtxstate,csub0
mtxstate=0 mtxstate=0
if(ltrace.ge.3) print*,'Mutex unlocked' if(ltrace.ge.3) print*,'Mutex unlocked'
call LeaveCriticalSection(mtx) call LeaveCriticalSection(mtx)

View File

@ -1,7 +1,8 @@
subroutine cs_init subroutine cs_init
character*12 csub0 character*12 csub0
common/mtxcom/ltrace,mtx,mtxstate,csub0 integer*8 mtx
ltrace=0 common/mtxcom/mtx,ltrace,mtxstate,csub0
ltrace=3
mtxstate=0 mtxstate=0
csub0='**unlocked**' csub0='**unlocked**'
call fthread_mutex_init(mtx) call fthread_mutex_init(mtx)
@ -10,7 +11,8 @@ end subroutine cs_init
subroutine cs_destroy subroutine cs_destroy
character*12 csub0 character*12 csub0
common/mtxcom/ltrace,mtx,mtxstate,csub0 integer*8 mtx
common/mtxcom/mtx,ltrace,mtxstate,csub0
call fthread_mutex_destroy(mtx) call fthread_mutex_destroy(mtx)
return return
end subroutine cs_destroy end subroutine cs_destroy
@ -29,7 +31,8 @@ subroutine cs_lock(csub)
character*(*) csub character*(*) csub
character*12 csub0 character*12 csub0
integer fthread_mutex_lock,fthread_mutex_trylock integer fthread_mutex_lock,fthread_mutex_trylock
common/mtxcom/ltrace,mtx,mtxstate,csub0 integer*8 mtx
common/mtxcom/mtx,ltrace,mtxstate,csub0
n=fthread_mutex_trylock(mtx) n=fthread_mutex_trylock(mtx)
if(n.ne.0) then if(n.ne.0) then
! Another thread has already locked the mutex ! Another thread has already locked the mutex
@ -46,7 +49,8 @@ end subroutine cs_lock
subroutine cs_unlock subroutine cs_unlock
character*12 csub0 character*12 csub0
common/mtxcom/ltrace,mtx,mtxstate,csub0 integer*8 mtx
common/mtxcom/mtx,ltrace,mtxstate,csub0
if(ltrace.ge.3) print*,'Mutex unlocked,',ltrace,mtx,mtxstate,csub0 if(ltrace.ge.3) print*,'Mutex unlocked,',ltrace,mtx,mtxstate,csub0
mtxstate=0 mtxstate=0
call fthread_mutex_unlock(mtx) call fthread_mutex_unlock(mtx)