diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1999-01-16 23:28:40 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1999-01-16 23:28:40 +0000 |
commit | 6614e82b2e53c21c152c1e540e839fa076db1e9a (patch) | |
tree | 90dab04e1db603fd4dafc096c74e3c6d7b616a25 | |
parent | e1ac025776e52e23c29f747fdcf4d1448619ff6d (diff) | |
download | ATCD-6614e82b2e53c21c152c1e540e839fa076db1e9a.tar.gz |
.
-rw-r--r-- | ChangeLog-99b | 4 | ||||
-rw-r--r-- | ace/OS.cpp | 68 | ||||
-rw-r--r-- | ace/Proactor.cpp | 2 |
3 files changed, 35 insertions, 39 deletions
diff --git a/ChangeLog-99b b/ChangeLog-99b index 39cf733d758..0d77f5774ae 100644 --- a/ChangeLog-99b +++ b/ChangeLog-99b @@ -1,5 +1,9 @@ Sat Jan 16 13:40:40 1999 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> + * ace/Proactor.cpp (schedule_timer): Had to add an + ACE_SYNCH_RECURSIVE_THREAD_MUTEX in place of + ACE_Recursive_Thread_Mutex to avoid problems when threads=0. + * ace/OS.cpp (lwp_getparams): For some reason we had to add diff --git a/ace/OS.cpp b/ace/OS.cpp index 36d2437ce57..39c8fbbd9f0 100644 --- a/ace/OS.cpp +++ b/ace/OS.cpp @@ -3091,20 +3091,18 @@ ACE_OS::thr_exit (void *status) int ACE_OS::lwp_getparams (ACE_Sched_Params &sched_params) { -# if defined (ACE_HAS_STHREADS) || defined (sun) +# if defined (ACE_HAS_STHREADS) || (defined (sun) && (ACE_MT_SAFE != 0)) // Get the class TS and RT class IDs. ACE_id_t rt_id; ACE_id_t ts_id; - if (ACE_OS::scheduling_class ("RT", rt_id) == -1 || - (ACE_OS::scheduling_class ("TS", ts_id) == -1)) - { - return -1; - } + if (ACE_OS::scheduling_class ("RT", rt_id) == -1 + || ACE_OS::scheduling_class ("TS", ts_id) == -1) + return -1; // Get this LWP's scheduling parameters. pcparms_t pcparms; - /* The following is just to avoid Purify warnings about unitialized - memory reads. */ + // The following is just to avoid Purify warnings about unitialized + // memory reads. ACE_OS::memset (&pcparms, 0, sizeof pcparms); pcparms.pc_cid = PC_CLNULL; @@ -3112,42 +3110,36 @@ ACE_OS::lwp_getparams (ACE_Sched_Params &sched_params) P_MYID, PC_GETPARMS, (char *) &pcparms) == -1) + return -1; + else if (pcparms.pc_cid == rt_id) { - return -1; + // RT class. + rtparms_t rtparms; + ACE_OS::memcpy (&rtparms, pcparms.pc_clparms, sizeof rtparms); + + sched_params.policy (ACE_SCHED_FIFO); + sched_params.priority (rtparms.rt_pri); + sched_params.scope (ACE_SCOPE_THREAD); + ACE_Time_Value quantum (rtparms.rt_tqsecs, + rtparms.rt_tqnsecs == RT_TQINF + ? 0 : rtparms.rt_tqnsecs * 1000); + sched_params.quantum (quantum); + return 0; } - else + else if (pcparms.pc_cid == ts_id) { - if (pcparms.pc_cid == rt_id) - { - /* RT class */ - rtparms_t rtparms; - ACE_OS::memcpy (&rtparms, pcparms.pc_clparms, sizeof rtparms); - - sched_params.policy (ACE_SCHED_FIFO); - sched_params.priority (rtparms.rt_pri); - sched_params.scope (ACE_SCOPE_THREAD); - ACE_Time_Value quantum (rtparms.rt_tqsecs, - rtparms.rt_tqnsecs == RT_TQINF ? 0 - : rtparms.rt_tqnsecs * 1000); - sched_params.quantum (quantum); - } - else if (pcparms.pc_cid == ts_id) - { - /* TS class */ - tsparms_t tsparms; - ACE_OS::memcpy (&tsparms, pcparms.pc_clparms, sizeof tsparms); + /* TS class */ + tsparms_t tsparms; + ACE_OS::memcpy (&tsparms, pcparms.pc_clparms, sizeof tsparms); - sched_params.policy (ACE_SCHED_RR); - sched_params.priority (tsparms.ts_upri); - sched_params.scope (ACE_SCOPE_THREAD); - } - else - { - return -1; - } + sched_params.policy (ACE_SCHED_RR); + sched_params.priority (tsparms.ts_upri); + sched_params.scope (ACE_SCOPE_THREAD); + return 0; } + else + return -1; - return 0; # else /* ! ACE_HAS_STHREADS && ! sun */ ACE_UNUSED_ARG (sched_params); ACE_NOTSUP_RETURN (-1); diff --git a/ace/Proactor.cpp b/ace/Proactor.cpp index 8af2f91f548..11e57845a3a 100644 --- a/ace/Proactor.cpp +++ b/ace/Proactor.cpp @@ -658,7 +658,7 @@ ACE_Proactor::schedule_timer (ACE_Handler &handler, this->timer_queue_->gettimeofday () + time; // Only one guy goes in here at a time - ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->timer_queue_->mutex (), -1); + ACE_GUARD_RETURN (ACE_SYNCH_RECURSIVE_MUTEX, ace_mon, this->timer_queue_->mutex (), -1); // Schedule the timer long result = this->timer_queue_->schedule (&handler, |