=================================================================== RCS file: /home/cvs/OpenXM/src/ox_math/serv1.c,v retrieving revision 1.21 retrieving revision 1.23 diff -u -p -r1.21 -r1.23 --- OpenXM/src/ox_math/serv1.c 2003/02/12 08:28:41 1.21 +++ OpenXM/src/ox_math/serv1.c 2005/07/26 12:52:04 1.23 @@ -1,5 +1,5 @@ /* -*- mode: C; coding: euc-japan -*- */ -/* $OpenXM: OpenXM/src/ox_math/serv1.c,v 1.20 2003/01/13 12:04:53 ohara Exp $ */ +/* $OpenXM: OpenXM/src/ox_math/serv1.c,v 1.22 2003/02/13 01:29:38 ohara Exp $ */ /* Copyright (C) Katsuyoshi OHARA, 2000. @@ -23,6 +23,7 @@ extern OXFILE *stack_oxfp; static int exchange_ox_sync_ball(OXFILE *oxfp) { int tag; + ox_printf("exchanging OX_SYNC_BALL\n"); send_ox_tag(oxfp, OX_SYNC_BALL); while((tag = receive_ox_tag(oxfp)) != OX_SYNC_BALL) { if (tag == OX_DATA) { @@ -41,8 +42,7 @@ int shutdown() } /* (Heisei)15/02/01 */ -#define VERSION 0x15020100 -#define ID_STRING "2003/02/01" +#define VERSION "2003/02/01" int main() { @@ -50,7 +50,7 @@ int main() ox_stderr_init(stderr); ml_init(); - mathcap_init(VERSION, ID_STRING, "ox_math", NULL, NULL); + mathcap_init(VERSION, "ox_math"); sv = oxf_open(3); oxf_determine_byteorder_server(sv); @@ -94,20 +94,20 @@ int sm(OXFILE *oxfp) FD_ZERO(&fdmask); FD_SET(oxf_fileno(oxfp), &fdmask); - while(1) { + for (i=0; ; i++) { + sm_sigunmask(); ox_printf("phase%d: select\n",i); if (select(5, &fdmask, NULL, NULL, NULL) > 0) { sm_sigmask(); ox_printf("phase%d: receiving\n",i); sm_receive_ox(); - sm_sigunmask(); /* unmasked. */ } + sm_sigmask(); ox_printf("phase%d: clearing(%d)\n",i,sm_state_interrupting()); if (sm_state_interrupting()) { exchange_ox_sync_ball(stack_oxfp); sm_state_clear_interrupting(); } - i++; } ox_printf("ox_math::socket(%d) is closed.\n", stack_oxfp->fd); }