Skip to content

Commit

Permalink
changed: tst for lib modstd.lib
Browse files Browse the repository at this point in the history
  • Loading branch information
hannes14 committed Nov 28, 2011
1 parent d151574 commit cc36533
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 48 deletions.
14 changes: 11 additions & 3 deletions Singular/semaphore.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,26 @@ void sipc_semaphore_release(int id) {
sem_post(semaphore[id]);
}

int sipc_semaphore_get_value(int id) {
int val;
sem_post(semaphore[id], &val);
return val;
}

int simpleipc_cmd(char *cmd, int id, int v)
{
if (strcmp(cmd,"init")==0)
return sipc_semaphore_init(id,v);
else if (strcmp(cmd,"exists")==0)
return sipc_semaphore_exists(id);
else if (strcmp(cmd,"acquire")==0)
{ sipc_semaphore_acquire(id); return;}
{ sipc_semaphore_acquire(id); return -2;}
else if (strcmp(cmd,"try_acquire")==0)
return sipc_semaphore_try_acquire(id);
else if (strcmp(cmd,"release")==0)
{ sipc_semaphore_release(id); return;}
{ sipc_semaphore_release(id); return -2;}
else if (strcmp(cmd,"get_value")==0)
{ return sipc_semaphore_get_value(id); }
else printf("unknown\n");
return 0;
return -2;
}
1 change: 1 addition & 0 deletions Singular/simpleipc.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ int sipc_semaphore_init(int id, int count);
int sipc_semaphore_exists(int id);
void sipc_semaphore_acquire(int id);
int sipc_semaphore_try_acquire(int id);
int sipc_semaphore_get_value(int id);
void sipc_semaphore_release(int id);

int simpleipc_cmd(char *cmd, int id, int v);
Expand Down
80 changes: 39 additions & 41 deletions Tst/Short/modstd.res.gz.uu
Original file line number Diff line number Diff line change
@@ -1,44 +1,42 @@
begin 640 modstd.res.gz
M'XL(".]V\TT``VUO9'-T9"YR97,`W5G=;R.W$7_77T$<\B"97$G\VI5BV$""
M!(T$]W*XNR(!BG/@DS9W:F7)L-;MKO[Z#LDE.:14^YKD)=6#M)SOW\QPR(7>
MO?]N\9H0PJ_)S>);\JHY-./MYN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;@BDA$P^G@46E'A@[S=(PX6*K<
M'U]F(<>;AX_."X''1,]G(5)RLA>&^=%0_#*/+U>%2"E+$A.6.1>%V6H#4/A:
MARP41#,+X+DTU87OY[T%<4O)M+!+##>!]Q&4V80;!BU&,1/$+3_$K<]4S"U'
MPIY)'ZNTV7?ZW$.5J`R]%4F;0IF=Q'DMO=Z]"]<&5;@FH,[*D74>V>;>TC:/
M0MN2B2NBN"B&/LB05^2C[$]DX?/I:A3<S@H5.>91P34AY0BAR?([/]ZLT4U+
M^C@YESA"'ODGE?-N`9M#!]ZF1*8G*.$,;P$Y*Z/#TQJ$>YER-X:\*I.^LKIP
M(V)I1\'9P9)^RDWTL$^RJ?=JSR<6_.LJ)[<V-CL)]R0VM65Q:67AR'0-@Q$"
M=14=/Z2<8*I$S'JJA,]2JKS$5',A]ZA.TIV0,#Z)N);1]32WZG#W8I,9)FM#
M>JXS/U.6:YE2G49,2X&9VN6!J2O"`:91>^@:)T2)FJ0\IYAE7K&(Y2SF6$84
MIQ)1Y)-^RK@?H6E"TEZ(0^]R%K.,6Y=QU[J,I2RC[9#,4I*L2DCF(JIE2(OM
JRXAESJ=1U[*I8^F^AI7A=P56C<U/%_KWB><M?",[_6KP)WMWISCP&```
`
end
8 changes: 4 additions & 4 deletions Tst/Short/modstd.stat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
1 >> tst_memory_0 :: 1307801327:3132- 14004 :3-1-3:ix86-Linux:mamawutz:395352
1 >> tst_memory_1 :: 1307801327:3132- 14004 :3-1-3:ix86-Linux:mamawutz:1261568
1 >> tst_memory_2 :: 1307801327:3132- 14004 :3-1-3:ix86-Linux:mamawutz:1416140
1 >> tst_timer_1 :: 1307801327:3132- 14004 :3-1-3:ix86-Linux:mamawutz:55
1 >> tst_memory_0 :: 1322474787:3133- 14004 :3-1-3:ix86-Linux:mamawutz:387040
1 >> tst_memory_1 :: 1322474787:3133- 14004 :3-1-3:ix86-Linux:mamawutz:1261568
1 >> tst_memory_2 :: 1322474787:3133- 14004 :3-1-3:ix86-Linux:mamawutz:1418712
1 >> tst_timer_1 :: 1322474787:3133- 14004 :3-1-3:ix86-Linux:mamawutz:54

0 comments on commit cc36533

Please sign in to comment.