version 1.21, 2003/02/12 08:28:41 |
version 1.22, 2003/02/13 01:29:38 |
|
|
/* -*- mode: C; coding: euc-japan -*- */ |
/* -*- 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.21 2003/02/12 08:28:41 ohara Exp $ */ |
|
|
/* |
/* |
Copyright (C) Katsuyoshi OHARA, 2000. |
Copyright (C) Katsuyoshi OHARA, 2000. |
Line 23 extern OXFILE *stack_oxfp; |
|
Line 23 extern OXFILE *stack_oxfp; |
|
static int exchange_ox_sync_ball(OXFILE *oxfp) |
static int exchange_ox_sync_ball(OXFILE *oxfp) |
{ |
{ |
int tag; |
int tag; |
|
ox_printf("exchanging OX_SYNC_BALL\n"); |
send_ox_tag(oxfp, OX_SYNC_BALL); |
send_ox_tag(oxfp, OX_SYNC_BALL); |
while((tag = receive_ox_tag(oxfp)) != OX_SYNC_BALL) { |
while((tag = receive_ox_tag(oxfp)) != OX_SYNC_BALL) { |
if (tag == OX_DATA) { |
if (tag == OX_DATA) { |
Line 94 int sm(OXFILE *oxfp) |
|
Line 95 int sm(OXFILE *oxfp) |
|
FD_ZERO(&fdmask); |
FD_ZERO(&fdmask); |
FD_SET(oxf_fileno(oxfp), &fdmask); |
FD_SET(oxf_fileno(oxfp), &fdmask); |
|
|
while(1) { |
for (i=0; ; i++) { |
|
sm_sigunmask(); |
ox_printf("phase%d: select\n",i); |
ox_printf("phase%d: select\n",i); |
if (select(5, &fdmask, NULL, NULL, NULL) > 0) { |
if (select(5, &fdmask, NULL, NULL, NULL) > 0) { |
sm_sigmask(); |
sm_sigmask(); |
ox_printf("phase%d: receiving\n",i); |
ox_printf("phase%d: receiving\n",i); |
sm_receive_ox(); |
sm_receive_ox(); |
sm_sigunmask(); /* unmasked. */ |
|
} |
} |
|
sm_sigmask(); |
ox_printf("phase%d: clearing(%d)\n",i,sm_state_interrupting()); |
ox_printf("phase%d: clearing(%d)\n",i,sm_state_interrupting()); |
if (sm_state_interrupting()) { |
if (sm_state_interrupting()) { |
exchange_ox_sync_ball(stack_oxfp); |
exchange_ox_sync_ball(stack_oxfp); |
sm_state_clear_interrupting(); |
sm_state_clear_interrupting(); |
} |
} |
i++; |
|
} |
} |
ox_printf("ox_math::socket(%d) is closed.\n", stack_oxfp->fd); |
ox_printf("ox_math::socket(%d) is closed.\n", stack_oxfp->fd); |
} |
} |