Skip to content

Commit

Permalink
fix mutexes + gtdot test
Browse files Browse the repository at this point in the history
  • Loading branch information
moon-chilled committed Jun 2, 2022
1 parent c3313e3 commit 08b755a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion jsrc/mt.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ static inline I jtpthread_mutex_timedlock(J jt,jtpthread_mutex_t *m,UI ns,I self
static inline I jtpthread_mutex_trylock(jtpthread_mutex_t *m,I self){
I4 r=pthread_mutex_trylock(m);
if(!r)R 0;
if(r==ETIMEDOUT)R -1;
if(r==EBUSY)R -1;
if(r==EAGAIN)R EVLIMIT; //'max recursive locks exceeded'
if(r==EDEADLK||r==EOWNERDEAD)R EVCONCURRENCY;
R EVFACE;}
static inline C jtpthread_mutex_unlock(jtpthread_mutex_t *m,I self){
Expand Down
4 changes: 2 additions & 2 deletions test/gtdot.ijs
Original file line number Diff line number Diff line change
Expand Up @@ -282,15 +282,15 @@ assert. remote_stuff=2
assert. remote_stuff=4
NB. mutex
mtx =. 10 T. 0
0 = >{{11 T. mtx;0}}t.''0
0 = >{{11 T. y;0}}t.''mtx
1 = 11 T. mtx;0
mtx =. 10 T. 0
0 = 11 T. mtx
'domain error' -: 11 T. etx >: mtx
13 T. mtx
mtx =. 10 T. 0
tod =. 6!:1''
0 = >{{11 T. <mtx}}t.''0 NB. boxed mtx OK
0 = >{{11 T. <y}}t.''mtx NB. boxed mtx OK
1 = 11 T. mtx;2.0
(2.005 > dly) *. 2 <: dly =. tod-~6!:1'' NB. verify delay
tod =. 6!:1''
Expand Down

0 comments on commit 08b755a

Please sign in to comment.