diff --git a/map65.py b/map65.py index 3c1a0a6e3..a63b5c3a7 100644 --- a/map65.py +++ b/map65.py @@ -1,4 +1,4 @@ -#-------------------------------------------------------------------- MAP65 +#--------------------------------------------------------------------- MAP65 # $Date$ $Revision$ # from Tkinter import * diff --git a/recvpkt.F90 b/recvpkt.F90 index 077095099..85b8cb101 100644 --- a/recvpkt.F90 +++ b/recvpkt.F90 @@ -19,7 +19,10 @@ subroutine recvpkt(iarg) data multicast0/-99/ 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 kk=0 kxp=0 diff --git a/thcvf.f90 b/thcvf.f90 index 9285c6a32..74257c180 100644 --- a/thcvf.f90 +++ b/thcvf.f90 @@ -2,8 +2,9 @@ subroutine cs_init use dfmt type (RTL_CRITICAL_SECTION) ncrit1 character*12 csub0 - common/mtxcom/ltrace,mtx,mtxstate,csub0 - ltrace=1 + integer*8 mtx + common/mtxcom/mtx,ltrace,mtxstate,csub0 + ltrace=0 mtx=loc(ncrit1) mtxstate=0 csub0='**unlocked**' @@ -15,7 +16,8 @@ subroutine cs_destroy use dfmt type (RTL_CRITICAL_SECTION) ncrit1 character*12 csub0 - common/mtxcom/ltrace,mtx,mtxstate,csub0 + integer*8 mtx + common/mtxcom/mtx,ltrace,mtxstate,csub0 call DeleteCriticalSection(mtx) return end subroutine cs_destroy @@ -38,7 +40,8 @@ subroutine cs_lock(csub) use dfmt character*(*) csub character*12 csub0 - common/mtxcom/ltrace,mtx,mtxstate,csub0 + integer*8 mtx + common/mtxcom/mtx,ltrace,mtxstate,csub0 n=TryEnterCriticalSection(mtx) if(n.eq.0) then ! Another thread has already locked the mutex @@ -56,7 +59,8 @@ end subroutine cs_lock subroutine cs_unlock use dfmt character*12 csub0 - common/mtxcom/ltrace,mtx,mtxstate,csub0 + integer*8 mtx + common/mtxcom/mtx,ltrace,mtxstate,csub0 mtxstate=0 if(ltrace.ge.3) print*,'Mutex unlocked' call LeaveCriticalSection(mtx) diff --git a/thnix.f90 b/thnix.f90 index 271bc2836..b9f115b95 100644 --- a/thnix.f90 +++ b/thnix.f90 @@ -1,7 +1,8 @@ subroutine cs_init character*12 csub0 - common/mtxcom/ltrace,mtx,mtxstate,csub0 - ltrace=0 + integer*8 mtx + common/mtxcom/mtx,ltrace,mtxstate,csub0 + ltrace=3 mtxstate=0 csub0='**unlocked**' call fthread_mutex_init(mtx) @@ -10,7 +11,8 @@ end subroutine cs_init subroutine cs_destroy character*12 csub0 - common/mtxcom/ltrace,mtx,mtxstate,csub0 + integer*8 mtx + common/mtxcom/mtx,ltrace,mtxstate,csub0 call fthread_mutex_destroy(mtx) return end subroutine cs_destroy @@ -29,7 +31,8 @@ subroutine cs_lock(csub) character*(*) csub character*12 csub0 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) if(n.ne.0) then ! Another thread has already locked the mutex @@ -46,7 +49,8 @@ end subroutine cs_lock subroutine cs_unlock 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 mtxstate=0 call fthread_mutex_unlock(mtx)