summaryrefslogtreecommitdiffstats
path: root/thread.c
Commit message (Collapse)AuthorAgeFilesLines
* * thread.c (thread_start_func_2): sets native thread key.nobu2008-12-241-0/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2008-12-221-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (sleep_timeval): cast tv_usec to long to shut upmatz2008-12-151-2/+2
| | | | | | warnings on OSX. [ruby-dev:37449] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_mutex_unlock): shut up warning. a patch frommatz2008-12-101-1/+1
| | | | | | Kazuhiro NISHIYAMA in [ruby-dev:37345]. fix #846 git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (iseq_compile_each), gc.c (assign_heap_slot),nobu2008-12-091-11/+12
| | | | | | | | | | | | | (gc_mark_children), parse.y (vtable_alloc, vtable_free, vtable_add), proc.c (proc_to_s), thread.c (terminate_i, rb_thread_terminate_all), (thread_start_func_2, blocking_region_begin, blocking_region_end), (rb_thread_kill), thread_pthread.c (native_thread_create), (ubf_pthread_cond_signal), vm.c (check_env, thread_free), vm_dump.c (vm_env_dump_raw, vm_stack_dump_each, vm_thread_dump_state), (vm_call0): use void pointer for %p. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* move the previous comment.akr2008-12-021-0/+28
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (ruby_stack_check): no check if using sigaltstack.nobu2008-11-271-0/+8
| | | | | | | | | | | | | | | | * signal.c (register_sigaltstack): minimum size is insufficient for method calls. * signal.c (sigsegv): handles stack overflow if possible. * thread.c (ruby_thread_stack_overflow): helper function to raise sysstack_error. * thread_pthread.c (ruby_stack_overflowed_p): checks for stack overflow. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_fork): stops the timer thread during fork.nobu2008-11-241-0/+1
| | | | | | | | | | [ruby-dev:37117] * thread.c (rb_thread_start_timer_thread): timer thread needs system_working to be set. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_barrier_wait): gets rid of recursive deadlock.nobu2008-11-131-0/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_barrier_{new,wait,release,destroy}): use Mutex so thatnobu2008-11-121-134/+14
| | | | | | | circular requires fail with deadlock. [ruby-core:19821] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * load.c (rb_require_safe): destroys barrier after successfullynobu2008-11-111-5/+31
| | | | | | | | | | | | loaded, to get rid of loading same library again. [ruby-core:19798] * thread.c (rb_barrier_wait): can not wait destroyed barrier. * thread.c (rb_barrier_destroy): destroys barrier so that no longer waited. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread_pthread.c (thread_timer): checks working flags again.nobu2008-11-081-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_thread_stop_timer_thread): terminates timer threadnobu2008-11-061-4/+4
| | | | | | | immediately. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h (rb_mutex_synchronize): fixed prototype.nobu2008-11-031-1/+1
| | | | | | | * thread.c (rb_mutex_synchronize): fixed function name. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (blocking_region_{begin,end}): declared as inline.nobu2008-10-261-3/+3
| | | | | | | | | * util.c (freedtoa): used only when MULTIPLE_THREADS is not defined. * win32/win32.c (rb_w32_pipe): serial is DWORD. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_thread_wait_fd_rw): should not block by select ifmatz2008-10-081-0/+1
| | | | | | there's only one thread living. fixed [ruby-dev:36646]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (thlist_signal): clears the woken thread if nothing woke.nobu2008-09-261-3/+6
| | | | | | | | * thread.c (rb_barrier_wait): achieves the lock if no thread was waiting yet. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/rubysig.h: old macros for backward compatibility.nobu2008-09-261-12/+57
| | | | | | | * thread.c (BLOCKING_REGION): rewritten using helper functions. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_thread_blocking_region): fix typo in a document.ko12008-09-231-1/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_thread_blocking_region): write a documentko12008-09-231-0/+28
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c, include/ruby/intern.h (rb_thread_interrupted): added.ko12008-09-231-0/+9
| | | | | | | | * io.c: use VALUE of thead instead of rb_tread_t to check interrupts. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * common.mk: clean upko12008-09-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | - remove blockinlining.$(OBJEXT) to built - make ENCODING_H_INCLDUES variable (include/ruby/encoding.h) - make VM_CORE_H_INCLUDES variable (vm_core.h) - simplify rules. - make depends rule to output depend status using gcc -MM. * include/ruby/mvm.h, include/ruby/vm.h: rename mvm.h to vm.h. * include/ruby.h: ditto. * load.c: add inclusion explicitly. * enumerator.c, object.c, parse.y, thread.c, vm_dump.c: remove useless inclusion. * eval_intern.h: cleanup inclusion. * vm_core.h: rb_thread_t should be defined in this file. * vm_evalbody.c, vm_exec.c: rename vm_evalbody.c to vm_exec.c. * vm.h, vm_exec.h: rename vm.h to vm_exec.h. * insnhelper.h, vm_insnhelper.h: rename insnhelper.h to vm_insnhelper.h. * vm.c, vm_insnhelper.c, vm_insnhelper.h: - rename vm_eval() to vm_exec_core(). - rename vm_eval_body() to vm_exec(). - cleanup include order. * vm_method.c: fix comment. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (iseq_data_to_ary): make it static.ko12008-09-041-1/+1
| | | | | | | | * thread.c (thgroup_enclose): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_thread_critical): removed.ko12008-09-041-2/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_thread_check_trap_pending): added for compatibility.ko12008-09-041-0/+10
| | | | | | | | | * ext/tk/tcltklib.c, ext/tk/tkutil/tkutil.c: remove ruby/signal.h dependency. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h (struct rb_vm_struct): replaced signal staff with trapnobu2008-09-041-6/+6
| | | | | | | | | | | | | | | | | | | | staff. * signal.c (signal_buff): per process resouce now. * signal.c (trap_list): moved to VM. * signal.c (rb_get_next_signal): reverted. * signal.c (rb_trap_exit): trap_pending_list was no longer used. * thread.c (timer_thread_function): delivers buffered per-process signals to each VMs. * vm.c (rb_vm_mark): marks trap_list. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix a typo.akr2008-08-311-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h: rename RB_UBF_DFL toko12008-08-311-2/+2
| | | | | | | | | | RUBY_UBF_IO and RUBY_UBF_PROCESS. Because there is no default (universal) unblocking function. * ext/socket/socket.c, file.c, io.c, process.c, thread.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (rb_intern_const): tiny optimization.nobu2008-08-161-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_thread_priority_set): get rid of C99 feature.nobu2008-08-141-1/+1
| | | | | | | * transcode.c (transcode_search_path): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_thread_execute_interrupts): switch eventko12008-08-131-5/+1
| | | | | | | | should be occur only once. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_thread_check_ints): added. please note thatko12008-08-131-0/+13
| | | | | | | | | | | this function may cause ruby's thread switching. * include/ruby/intern.h: ditto. * regint.h: use rb_thread_check_ints() instead of RUBY_CHECK_INTS() directly. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c, vm_core.h: add manual priority supportko12008-08-131-1/+38
| | | | | | | | | | | using time slice. if you enable USE_NATIVE_THREAD_PRIORITY macro, this mechanism is ignored. [ruby-dev:33124] * thread_pthread.c, thread_win32.c: ditto. * test/ruby/test_thread.rb: fix test parameter. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (thread_start_func_2): propagates fatal error and systemnobu2008-08-051-5/+19
| | | | | | | exit to the main thread. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_mutex_unlock_all): mutex is no longer a ruby object.nobu2008-07-301-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * win32/win32.c (rb_w32_select): recalc the rest of timeout for eachnobu2008-07-301-5/+24
| | | | | | | iterations. [ruby-core:18015] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread_win32.[ch] (cond_every_entry, rb_thread_cond_struct): revertedusa2008-07-281-10/+11
| | | | | | | | | | | r18239 because r18245 made the changes unnecessary. * thread.c (rb_mutex_struct): define after including thread_{pthread, win32}.c. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h: move the definition of struct rb_mutex_struct.mame2008-07-281-1/+8
| | | | | | | * thread.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (mutex_unlock): fix typo.mame2008-07-281-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h, thread.c: It is now prohibited to use Data_Get_Struct inmame2008-07-271-30/+13
| | | | | | | | | | *_free against an object that is going to be free'ed. So, change type of thread_t#keeping_mutexes from VALUE to mutex_t. * vm.c: remove mark to keeping_mutexes. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h: add a type T_DEFERRED.ko12008-07-271-3/+13
| | | | | | | | | | | | | | * gc.c: fix deferred finalizer system. finalize processes of T_DATA and T_FILE are executed after gc process. And fix to use BUILTIN_TYPE() instead of seeing flag. * thread.c, vm_core.h: add RUBY_VM_SET_FINALIZER_INTERRUPT() and check intterupt_flag at rb_thread_execute_interrupts(). * thread.c (mutex_mark): fix to mark next_mutex. * vm.c (rb_thread_mark): fix to mark keeping_mutexes. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (thread_start_func_2): wake up joining threads.nobu2008-07-161-30/+61
| | | | | | | | | | | * thread.c (sleep_forever, sleep_timeval): return when interrupted. [ruby-dev:35542] * thread.c (timer_thread_function): restore main thread status. [ruby-core:17270] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_wait_readable, rb_io_wait_writable): check if the filenobu2008-07-111-0/+3
| | | | | | | | | descriptor is closed. * thread.c (rb_thread_wait_fd_rw): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (thread_create_core): fix GC problem.ko12008-07-101-2/+2
| | | | | | | | [ruby-core:17669] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_thread_wait_for): fixed variable name.nobu2008-07-101-6/+6
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_thread_wait_for): wait until timed out only whennobu2008-07-101-24/+24
| | | | | | | sleeping with timeout. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (sleep_forever): wait until timed out. [ruby-core:17270]nobu2008-07-091-1/+39
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in (rb_cv_va_args_macro): check for __VA_ARGS__.nobu2008-07-091-4/+17
| | | | | | | * thread.c (thread_debug): show source name and line if possible. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread_{pthread,win32}.c (rb_thread_create_timer_thread): needs morenobu2008-07-091-1/+1
| | | | | | | stack for debug. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_set_coverages, rb_reset_coverages): enable and disablemame2008-07-081-27/+12
| | | | | | | | | | | | | | | | | | | | coverage measurement. * thread.c (rb_get_coverages): rename and move from vm.c. * vm.c (rb_vm_get_coverages): ditto. * iseq.c (prepare_iseq_build): ditto. * thread.c (clear_coverage): ditto. * parse.y (coverage): ditto. * ext/coverage/coverage.c: use above functions, add new method Coverage.start and fix rdoc . git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e