зеркало из https://github.com/github/ruby.git
* thread.c (thread_join): pthread_t may not be pointer.
* thread_pthread.ci (ubf_select_each): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
0fcf8e17aa
Коммит
1fe38a5cae
12
ChangeLog
12
ChangeLog
|
@ -1,7 +1,13 @@
|
||||||
Thu Jul 12 10:19:16 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Thu Jul 12 10:30:46 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* thread_pthread.ci (thread_start_func_2): not use a directive inside
|
* thread.c (thread_start_func_2): moved prototye from thread_*.ci.
|
||||||
a macro argument. [ruby-talk:258763]
|
|
||||||
|
* thread_pthread.ci (thread_start_func_2): not use a directive
|
||||||
|
inside a macro argument. [ruby-talk:258763]
|
||||||
|
|
||||||
|
* thread.c (thread_join): pthread_t may not be pointer.
|
||||||
|
|
||||||
|
* thread_pthread.ci (ubf_select_each): ditto.
|
||||||
|
|
||||||
Thu Jul 12 05:32:28 2007 NAKAMURA Usaku <usa@ruby-lang.org>
|
Thu Jul 12 05:32:28 2007 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
|
10
thread.c
10
thread.c
|
@ -389,7 +389,7 @@ thread_join(rb_thread_t *target_th, double delay)
|
||||||
rb_thread_t *th = GET_THREAD();
|
rb_thread_t *th = GET_THREAD();
|
||||||
double now, limit = timeofday() + delay;
|
double now, limit = timeofday() + delay;
|
||||||
|
|
||||||
thread_debug("thread_join (thid: %p)\n", target_th->thread_id);
|
thread_debug("thread_join (thid: %p)\n", (void*)target_th->thread_id);
|
||||||
|
|
||||||
if (target_th->status != THREAD_KILLED) {
|
if (target_th->status != THREAD_KILLED) {
|
||||||
th->join_list_next = target_th->join_list_head;
|
th->join_list_next = target_th->join_list_head;
|
||||||
|
@ -404,17 +404,17 @@ thread_join(rb_thread_t *target_th, double delay)
|
||||||
now = timeofday();
|
now = timeofday();
|
||||||
if (now > limit) {
|
if (now > limit) {
|
||||||
thread_debug("thread_join: timeout (thid: %p)\n",
|
thread_debug("thread_join: timeout (thid: %p)\n",
|
||||||
target_th->thread_id);
|
(void*)target_th->thread_id);
|
||||||
return Qnil;
|
return Qnil;
|
||||||
}
|
}
|
||||||
sleep_wait_for_interrupt(th, limit - now);
|
sleep_wait_for_interrupt(th, limit - now);
|
||||||
}
|
}
|
||||||
thread_debug("thread_join: interrupted (thid: %p)\n",
|
thread_debug("thread_join: interrupted (thid: %p)\n",
|
||||||
target_th->thread_id);
|
(void*)target_th->thread_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
thread_debug("thread_join: success (thid: %p)\n",
|
thread_debug("thread_join: success (thid: %p)\n",
|
||||||
target_th->thread_id);
|
(void*)target_th->thread_id);
|
||||||
|
|
||||||
if (target_th->errinfo != Qnil) {
|
if (target_th->errinfo != Qnil) {
|
||||||
VALUE err = target_th->errinfo;
|
VALUE err = target_th->errinfo;
|
||||||
|
@ -2349,7 +2349,7 @@ thlist_signal(rb_thread_list_t **list, unsigned int maxth)
|
||||||
int woken = 0;
|
int woken = 0;
|
||||||
rb_thread_list_t *q;
|
rb_thread_list_t *q;
|
||||||
|
|
||||||
while (q = *list) {
|
while ((q = *list) != 0) {
|
||||||
rb_thread_t *th = q->th;
|
rb_thread_t *th = q->th;
|
||||||
|
|
||||||
*list = q->next;
|
*list = q->next;
|
||||||
|
|
|
@ -301,7 +301,7 @@ ubf_pthread_cond_signal(rb_thread_t *th)
|
||||||
static void
|
static void
|
||||||
ubf_select_each(rb_thread_t *th)
|
ubf_select_each(rb_thread_t *th)
|
||||||
{
|
{
|
||||||
thread_debug("ubf_select_each (%p)\n", th->thread_id);
|
thread_debug("ubf_select_each (%p)\n", (void*)th->thread_id);
|
||||||
if (th) {
|
if (th) {
|
||||||
pthread_kill(th->thread_id, SIGVTALRM);
|
pthread_kill(th->thread_id, SIGVTALRM);
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче