/[emacs]/emacs/src/process.c
ViewVC logotype

Diff of /emacs/src/process.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.442 by handa, Wed Sep 29 23:43:08 2004 UTC revision 1.443 by kfstorm, Mon Nov 1 11:04:11 2004 UTC
# Line 310  static SELECT_TYPE non_keyboard_wait_mas Line 310  static SELECT_TYPE non_keyboard_wait_mas
310    
311  static SELECT_TYPE non_process_wait_mask;  static SELECT_TYPE non_process_wait_mask;
312    
313    #ifdef NON_BLOCKING_CONNECT
314  /* Mask of bits indicating the descriptors that we wait for connect to  /* Mask of bits indicating the descriptors that we wait for connect to
315     complete on.  Once they complete, they are removed from this mask     complete on.  Once they complete, they are removed from this mask
316     and added to the input_wait_mask and non_keyboard_wait_mask.  */     and added to the input_wait_mask and non_keyboard_wait_mask.  */
# Line 319  static SELECT_TYPE connect_wait_mask; Line 320  static SELECT_TYPE connect_wait_mask;
320  /* Number of bits set in connect_wait_mask.  */  /* Number of bits set in connect_wait_mask.  */
321  static int num_pending_connects;  static int num_pending_connects;
322    
323    #define IF_NON_BLOCKING_CONNECT(s) s
324    #else
325    #define IF_NON_BLOCKING_CONNECT(s)
326    #endif
327    
328  /* The largest descriptor currently in use for a process object.  */  /* The largest descriptor currently in use for a process object.  */
329  static int max_process_desc;  static int max_process_desc;
330    
# Line 3672  deactivate_process (proc) Line 3678  deactivate_process (proc)
3678        chan_process[inchannel] = Qnil;        chan_process[inchannel] = Qnil;
3679        FD_CLR (inchannel, &input_wait_mask);        FD_CLR (inchannel, &input_wait_mask);
3680        FD_CLR (inchannel, &non_keyboard_wait_mask);        FD_CLR (inchannel, &non_keyboard_wait_mask);
3681    #ifdef NON_BLOCKING_CONNECT
3682        if (FD_ISSET (inchannel, &connect_wait_mask))        if (FD_ISSET (inchannel, &connect_wait_mask))
3683          {          {
3684            FD_CLR (inchannel, &connect_wait_mask);            FD_CLR (inchannel, &connect_wait_mask);
3685            if (--num_pending_connects < 0)            if (--num_pending_connects < 0)
3686              abort ();              abort ();
3687          }          }
3688    #endif
3689        if (inchannel == max_process_desc)        if (inchannel == max_process_desc)
3690          {          {
3691            int i;            int i;
# Line 4038  wait_reading_process_output (time_limit, Line 4046  wait_reading_process_output (time_limit,
4046  {  {
4047    register int channel, nfds;    register int channel, nfds;
4048    SELECT_TYPE Available;    SELECT_TYPE Available;
4049    #ifdef NON_BLOCKING_CONNECT
4050    SELECT_TYPE Connecting;    SELECT_TYPE Connecting;
4051    int check_connect, check_delay, no_avail;    int check_connect;
4052    #endif
4053      int check_delay, no_avail;
4054    int xerrno;    int xerrno;
4055    Lisp_Object proc;    Lisp_Object proc;
4056    EMACS_TIME timeout, end_time;    EMACS_TIME timeout, end_time;
# Line 4050  wait_reading_process_output (time_limit, Line 4061  wait_reading_process_output (time_limit,
4061    int saved_waiting_for_user_input_p = waiting_for_user_input_p;    int saved_waiting_for_user_input_p = waiting_for_user_input_p;
4062    
4063    FD_ZERO (&Available);    FD_ZERO (&Available);
4064    #ifdef NON_BLOCKING_CONNECT
4065    FD_ZERO (&Connecting);    FD_ZERO (&Connecting);
4066    #endif
4067    
4068    /* If wait_proc is a process to watch, set wait_channel accordingly.  */    /* If wait_proc is a process to watch, set wait_channel accordingly.  */
4069    if (wait_proc != NULL)    if (wait_proc != NULL)
# Line 4187  wait_reading_process_output (time_limit, Line 4200  wait_reading_process_output (time_limit,
4200           timeout to get our attention.  */           timeout to get our attention.  */
4201        if (update_tick != process_tick && do_display)        if (update_tick != process_tick && do_display)
4202          {          {
4203            SELECT_TYPE Atemp, Ctemp;            SELECT_TYPE Atemp;
4204    #ifdef NON_BLOCKING_CONNECT
4205              SELECT_TYPE Ctemp;
4206    #endif
4207    
4208            Atemp = input_wait_mask;            Atemp = input_wait_mask;
4209  #if 0  #if 0
# Line 4199  wait_reading_process_output (time_limit, Line 4215  wait_reading_process_output (time_limit,
4215            */            */
4216            FD_CLR (0, &Atemp);            FD_CLR (0, &Atemp);
4217  #endif  #endif
4218            Ctemp = connect_wait_mask;            IF_NON_BLOCKING_CONNECT (Ctemp = connect_wait_mask);
4219    
4220            EMACS_SET_SECS_USECS (timeout, 0, 0);            EMACS_SET_SECS_USECS (timeout, 0, 0);
4221            if ((select (max (max_process_desc, max_keyboard_desc) + 1,            if ((select (max (max_process_desc, max_keyboard_desc) + 1,
4222                         &Atemp,                         &Atemp,
4223    #ifdef NON_BLOCKING_CONNECT
4224                         (num_pending_connects > 0 ? &Ctemp : (SELECT_TYPE *)0),                         (num_pending_connects > 0 ? &Ctemp : (SELECT_TYPE *)0),
4225    #else
4226                           (SELECT_TYPE *)0,
4227    #endif
4228                         (SELECT_TYPE *)0, &timeout)                         (SELECT_TYPE *)0, &timeout)
4229                 <= 0))                 <= 0))
4230              {              {
# Line 4263  wait_reading_process_output (time_limit, Line 4284  wait_reading_process_output (time_limit,
4284            if (XINT (wait_proc->infd) < 0)  /* Terminated */            if (XINT (wait_proc->infd) < 0)  /* Terminated */
4285              break;              break;
4286            FD_SET (XINT (wait_proc->infd), &Available);            FD_SET (XINT (wait_proc->infd), &Available);
4287            check_connect = check_delay = 0;            check_delay = 0;
4288              IF_NON_BLOCKING_CONNECT (check_connect = 0);
4289          }          }
4290        else if (!NILP (wait_for_cell))        else if (!NILP (wait_for_cell))
4291          {          {
4292            Available = non_process_wait_mask;            Available = non_process_wait_mask;
4293            check_connect = check_delay = 0;            check_delay = 0;
4294              IF_NON_BLOCKING_CONNECT (check_connect = 0);
4295          }          }
4296        else        else
4297          {          {
# Line 4276  wait_reading_process_output (time_limit, Line 4299  wait_reading_process_output (time_limit,
4299              Available = non_keyboard_wait_mask;              Available = non_keyboard_wait_mask;
4300            else            else
4301              Available = input_wait_mask;              Available = input_wait_mask;
4302            check_connect = (num_pending_connects > 0);            IF_NON_BLOCKING_CONNECT (check_connect = (num_pending_connects > 0));
4303            check_delay = wait_channel >= 0 ? 0 : process_output_delay_count;            check_delay = wait_channel >= 0 ? 0 : process_output_delay_count;
4304          }          }
4305    
# Line 4301  wait_reading_process_output (time_limit, Line 4324  wait_reading_process_output (time_limit,
4324          }          }
4325        else        else
4326          {          {
4327    #ifdef NON_BLOCKING_CONNECT
4328            if (check_connect)            if (check_connect)
4329              Connecting = connect_wait_mask;              Connecting = connect_wait_mask;
4330    #endif
4331    
4332  #ifdef ADAPTIVE_READ_BUFFERING  #ifdef ADAPTIVE_READ_BUFFERING
4333            if (process_output_skip && check_delay > 0)            if (process_output_skip && check_delay > 0)
# Line 4333  wait_reading_process_output (time_limit, Line 4358  wait_reading_process_output (time_limit,
4358    
4359            nfds = select (max (max_process_desc, max_keyboard_desc) + 1,            nfds = select (max (max_process_desc, max_keyboard_desc) + 1,
4360                           &Available,                           &Available,
4361    #ifdef NON_BLOCKING_CONNECT
4362                           (check_connect ? &Connecting : (SELECT_TYPE *)0),                           (check_connect ? &Connecting : (SELECT_TYPE *)0),
4363    #else
4364                             (SELECT_TYPE *)0,
4365    #endif
4366                           (SELECT_TYPE *)0, &timeout);                           (SELECT_TYPE *)0, &timeout);
4367          }          }
4368    
# Line 4389  wait_reading_process_output (time_limit, Line 4418  wait_reading_process_output (time_limit,
4418        if (no_avail)        if (no_avail)
4419          {          {
4420            FD_ZERO (&Available);            FD_ZERO (&Available);
4421            check_connect = 0;            IF_NON_BLOCKING_CONNECT (check_connect = 0);
4422          }          }
4423    
4424  #if defined(sun) && !defined(USG5_4)  #if defined(sun) && !defined(USG5_4)
# Line 6628  init_process () Line 6657  init_process ()
6657    FD_ZERO (&non_process_wait_mask);    FD_ZERO (&non_process_wait_mask);
6658    max_process_desc = 0;    max_process_desc = 0;
6659    
6660    #ifdef NON_BLOCKING_CONNECT
6661      FD_ZERO (&connect_wait_mask);
6662      num_pending_connects = 0;
6663    #endif
6664    
6665  #ifdef ADAPTIVE_READ_BUFFERING  #ifdef ADAPTIVE_READ_BUFFERING
6666    process_output_delay_count = 0;    process_output_delay_count = 0;
6667    process_output_skip = 0;    process_output_skip = 0;

Legend:
Removed from v.1.442  
changed lines
  Added in v.1.443

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26