diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-07-12 04:25:46 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-07-12 04:25:46 +0000 |
commit | 6b6bf4dd481f744faf54b5efcda5f32e4565bd7d (patch) | |
tree | 793fe567ccc6f9f6a8588a9ae2d5d5b040984b37 /thread.c | |
parent | 2e601474e7dc483aca0e7c7b7ced750e869aab7f (diff) | |
download | ruby-6b6bf4dd481f744faf54b5efcda5f32e4565bd7d.tar.gz |
* blockinlining.c: remove "yarv" prefix.
* array.c, numeric.c: ditto.
* insnhelper.ci, insns.def, vm_evalbody.ci: ditto.
* yarvcore.c: removed.
* yarvcore.h: renamed to core.h.
* cont.c, debug.c, error.c, process.c, signal.c : ditto.
* ext/probeprofiler/probeprofiler.c: ditto.
* id.c, id.h: added.
* inits.c: ditto.
* compile.c: rename internal functions.
* compile.h: fix debug flag.
* eval.c, object.c, vm.c: remove ruby_top_self.
use rb_vm_top_self() instead.
* eval_intern.h, eval_load: ditto.
* gc.c: rename yarv_machine_stack_mark() to
rb_gc_mark_machine_stack().
* insnhelper.h: remove unused macros.
* iseq.c: add iseq_compile() to create iseq object
from source string.
* proc.c: rename a internal function.
* template/insns.inc.tmpl: remove YARV prefix.
* thread.c:
* vm.c (rb_iseq_eval): added.
* vm.c: move some functions from yarvcore.c.
* vm_dump.c: fix to remove compiler warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 20 |
1 files changed, 11 insertions, 9 deletions
@@ -389,7 +389,7 @@ thread_join(rb_thread_t *target_th, double delay) rb_thread_t *th = GET_THREAD(); double now, limit = timeofday() + delay; - thread_debug("thread_join (thid: %p)\n", (void*)target_th->thread_id); + thread_debug("thread_join (thid: %p)\n", (void *)target_th->thread_id); if (target_th->status != THREAD_KILLED) { th->join_list_next = target_th->join_list_head; @@ -404,17 +404,17 @@ thread_join(rb_thread_t *target_th, double delay) now = timeofday(); if (now > limit) { thread_debug("thread_join: timeout (thid: %p)\n", - (void*)target_th->thread_id); + (void *)target_th->thread_id); return Qnil; } sleep_wait_for_interrupt(th, limit - now); } thread_debug("thread_join: interrupted (thid: %p)\n", - (void*)target_th->thread_id); + (void *)target_th->thread_id); } thread_debug("thread_join: success (thid: %p)\n", - (void*)target_th->thread_id); + (void *)target_th->thread_id); if (target_th->errinfo != Qnil) { VALUE err = target_th->errinfo; @@ -2349,7 +2349,7 @@ thlist_signal(rb_thread_list_t **list, unsigned int maxth) int woken = 0; rb_thread_list_t *q; - while ((q = *list) != 0) { + while ((q = *list) != NULL) { rb_thread_t *th = q->th; *list = q->next; @@ -2922,10 +2922,12 @@ Init_Thread(void) rb_define_method(rb_cMutex, "lock", rb_mutex_lock, 0); rb_define_method(rb_cMutex, "unlock", rb_mutex_unlock, 0); rb_define_method(rb_cMutex, "sleep", mutex_sleep, -1); - yarvcore_eval(Qnil, rb_str_new2( - "class Mutex;" - " def synchronize; self.lock; yield; ensure; self.unlock; end;" - "end;"), rb_str_new2("<preload>"), INT2FIX(1)); + + rb_iseq_eval(rb_iseq_compile( + rb_str_new2("class Mutex;" + " def synchronize; self.lock; yield; ensure; self.unlock; end;" + "end;"), + rb_str_new2(__FILE__), INT2FIX(__LINE__))); recursive_key = rb_intern("__recursive_key__"); rb_eThreadError = rb_define_class("ThreadError", rb_eStandardError); |