diff --git a/lib/jt9a.f90 b/lib/jt9a.f90 index bab2dfbdd..362c57887 100644 --- a/lib/jt9a.f90 +++ b/lib/jt9a.f90 @@ -25,6 +25,7 @@ subroutine jt9a() msdelay=30 call c_f_pointer(shmem_address(),shared_data) +<<<<<<< HEAD <<<<<<< HEAD ! Terminate if ipc(2) is 999 10 call lock_jt9() @@ -38,6 +39,19 @@ subroutine jt9a() call unlock_jt9() ======= ! Wait here until GUI has set ips(2) to 1.0 +10 ok=shmem_lock() + if(.not.ok) call abort + if(shared_data%ipc(2).eq.999.0) then + ok=shmem_unlock() + ok=shmem_detach() + go to 999 + endif + if(shared_data%ipc(2).ne.1.0) then + ok=shmem_unlock() + if(.not.ok) call abort +>>>>>>> 488c2e8066c538e496ff5d7caf8655a065525976 +======= +! Wait here until GUI has set ips(2) to 1.0 10 ok=shmem_lock() if(.not.ok) call abort if(shared_data%ipc(2).eq.999.0) then @@ -89,18 +103,24 @@ subroutine jt9a() call timer('decoder ',1) +<<<<<<< HEAD <<<<<<< HEAD ! Wait here until GUI routine decodeDone() has set ipc(3) to 1 100 call lock_jt9() if(shared_data%ipc(3).ne.1) then call unlock_jt9() ======= +======= +>>>>>>> 488c2e8066c538e496ff5d7caf8655a065525976 ! Wait here until GUI routine decodeDone() has set ipc(3) to 1.0 100 ok=shmem_lock() if(.not.ok) call abort if(shared_data%ipc(3).ne.1.0) then ok=shmem_unlock() if(.not.ok) call abort +<<<<<<< HEAD +>>>>>>> 488c2e8066c538e496ff5d7caf8655a065525976 +======= >>>>>>> 488c2e8066c538e496ff5d7caf8655a065525976 call sleep_msec(msdelay) go to 100 diff --git a/lib/shmem.cpp b/lib/shmem.cpp new file mode 100644 index 000000000..95a86614f --- /dev/null +++ b/lib/shmem.cpp @@ -0,0 +1,20 @@ +#include +#include + +// Multiple instances: KK1D, 17 Jul 2013 +QSharedMemory shmem; + +struct jt9com; + +// C wrappers for a QSharedMemory class instance +extern "C" +{ + bool shmem_create (int nsize) {return shmem.create(nsize);} + void shmem_setkey (char * const mykey) {shmem.setKey(QLatin1String{mykey});} + bool shmem_attach () {return shmem.attach();} + int shmem_size () {return static_cast (shmem.size());} + struct jt9com * shmem_address () {return reinterpret_cast(shmem.data());} + bool shmem_lock () {return shmem.lock();} + bool shmem_unlock () {return shmem.unlock();} + bool shmem_detach () {return shmem.detach();} +}