From 7729de4d91ffbf0fe8fa4f2a95b85d3406845471 Mon Sep 17 00:00:00 2001 From: marcandre Date: Mon, 17 May 2010 21:07:33 +0000 Subject: * array.c: Documentation: change => in call-seq to ->. Harmonize "#=>" in examples. [ruby-core:30206] * bignum.c: ditto * class.c: ditto * compar.c: ditto * cont.c: ditto * dir.c: ditto * encoding.c: ditto * enum.c: ditto * enumerator.c: ditto * error.c: ditto * eval.c: ditto * file.c: ditto * gc.c: ditto * io.c: ditto * load.c: ditto * marshal.c: ditto * math.c: ditto * numeric.c: ditto * object.c: ditto * pack.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * range.c: ditto * re.c: ditto * ruby.c: ditto * signal.c: ditto * sprintf.c: ditto * string.c: ditto * struct.c: ditto * thread.c: ditto * time.c: ditto * transcode.c: ditto * variable.c: ditto * vm_eval.c: ditto * vm_method.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread.c | 102 +++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 51 insertions(+), 51 deletions(-) (limited to 'thread.c') diff --git a/thread.c b/thread.c index 485c1462eb..f6b3b67df4 100644 --- a/thread.c +++ b/thread.c @@ -160,7 +160,7 @@ static int rb_thread_debug_enabled; /* * call-seq: - * Thread.DEBUG => num + * Thread.DEBUG -> num * * Returns the thread debug level. Available only if compiled with * THREAD_DEBUG=-1. @@ -582,8 +582,8 @@ thread_s_new(int argc, VALUE *argv, VALUE klass) /* * call-seq: - * Thread.start([args]*) {|args| block } => thread - * Thread.fork([args]*) {|args| block } => thread + * Thread.start([args]*) {|args| block } -> thread + * Thread.fork([args]*) {|args| block } -> thread * * Basically the same as Thread::new. However, if class * Thread is subclassed, then calling start in that @@ -731,8 +731,8 @@ thread_join(rb_thread_t *target_th, double delay) /* * call-seq: - * thr.join => thr - * thr.join(limit) => thr + * thr.join -> thr + * thr.join(limit) -> thr * * The calling thread will suspend execution and run thr. Does not * return until thr exits or until limit seconds have passed. If @@ -788,7 +788,7 @@ thread_join_m(int argc, VALUE *argv, VALUE self) /* * call-seq: - * thr.value => obj + * thr.value -> obj * * Waits for thr to complete (via Thread#join) and returns * its value. @@ -1222,7 +1222,7 @@ ruby_thread_has_gvl_p(void) /* * call-seq: - * Thread.pass => nil + * Thread.pass -> nil * * Invokes the thread scheduler to pass execution to another thread. * @@ -1454,9 +1454,9 @@ thread_raise_m(int argc, VALUE *argv, VALUE self) /* * call-seq: - * thr.exit => thr or nil - * thr.kill => thr or nil - * thr.terminate => thr or nil + * thr.exit -> thr or nil + * thr.kill -> thr or nil + * thr.terminate -> thr or nil * * Terminates thr and schedules another thread to be run. If this thread * is already marked to be killed, exit returns the @@ -1493,7 +1493,7 @@ rb_thread_kill(VALUE thread) /* * call-seq: - * Thread.kill(thread) => thread + * Thread.kill(thread) -> thread * * Causes the given thread to exit (see Thread::exit). * @@ -1514,7 +1514,7 @@ rb_thread_s_kill(VALUE obj, VALUE th) /* * call-seq: - * Thread.exit => thread + * Thread.exit -> thread * * Terminates the currently running thread and schedules another thread to be * run. If this thread is already marked to be killed, exit @@ -1531,7 +1531,7 @@ rb_thread_exit(void) /* * call-seq: - * thr.wakeup => thr + * thr.wakeup -> thr * * Marks thr as eligible for scheduling (it may still remain blocked on * I/O, however). Does not invoke the scheduler (see Thread#run). @@ -1563,7 +1563,7 @@ rb_thread_wakeup(VALUE thread) /* * call-seq: - * thr.run => thr + * thr.run -> thr * * Wakes up thr, making it eligible for scheduling. * @@ -1591,7 +1591,7 @@ rb_thread_run(VALUE thread) /* * call-seq: - * Thread.stop => nil + * Thread.stop -> nil * * Stops execution of the current thread, putting it into a ``sleep'' state, * and schedules execution of another thread. @@ -1641,7 +1641,7 @@ thread_list_i(st_data_t key, st_data_t val, void *data) /* * call-seq: - * Thread.list => array + * Thread.list -> array * * Returns an array of Thread objects for all threads that are * either runnable or stopped. @@ -1675,7 +1675,7 @@ rb_thread_current(void) /* * call-seq: - * Thread.current => thread + * Thread.current -> thread * * Returns the currently executing thread. * @@ -1696,7 +1696,7 @@ rb_thread_main(void) /* * call-seq: - * Thread.main => thread + * Thread.main -> thread * * Returns the main thread. */ @@ -1710,7 +1710,7 @@ rb_thread_s_main(VALUE klass) /* * call-seq: - * Thread.abort_on_exception => true or false + * Thread.abort_on_exception -> true or false * * Returns the status of the global ``abort on exception'' condition. The * default is false. When set to true, or if the @@ -1729,7 +1729,7 @@ rb_thread_s_abort_exc(void) /* * call-seq: - * Thread.abort_on_exception= boolean => true or false + * Thread.abort_on_exception= boolean -> true or false * * When set to true, all threads will abort if an exception is * raised. Returns the new state. @@ -1762,7 +1762,7 @@ rb_thread_s_abort_exc_set(VALUE self, VALUE val) /* * call-seq: - * thr.abort_on_exception => true or false + * thr.abort_on_exception -> true or false * * Returns the status of the thread-local ``abort on exception'' condition for * thr. The default is false. See also @@ -1780,7 +1780,7 @@ rb_thread_abort_exc(VALUE thread) /* * call-seq: - * thr.abort_on_exception= boolean => true or false + * thr.abort_on_exception= boolean -> true or false * * When set to true, causes all threads (including the main * program) to abort if an exception is raised in thr. The process will @@ -1801,7 +1801,7 @@ rb_thread_abort_exc_set(VALUE thread, VALUE val) /* * call-seq: - * thr.group => thgrp or nil + * thr.group -> thgrp or nil * * Returns the ThreadGroup which contains thr, or nil if * the thread is not a member of any group. @@ -1850,7 +1850,7 @@ rb_threadptr_dead(rb_thread_t *th) /* * call-seq: - * thr.status => string, false or nil + * thr.status -> string, false or nil * * Returns the status of thr: ``sleep'' if thr is * sleeping or waiting on I/O, ``run'' if thr is executing, @@ -1889,7 +1889,7 @@ rb_thread_status(VALUE thread) /* * call-seq: - * thr.alive? => true or false + * thr.alive? -> true or false * * Returns true if thr is running or sleeping. * @@ -1912,7 +1912,7 @@ rb_thread_alive_p(VALUE thread) /* * call-seq: - * thr.stop? => true or false + * thr.stop? -> true or false * * Returns true if thr is dead or sleeping. * @@ -1937,7 +1937,7 @@ rb_thread_stop_p(VALUE thread) /* * call-seq: - * thr.safe_level => integer + * thr.safe_level -> integer * * Returns the safe level in effect for thr. Setting thread-local safe * levels can help when implementing sandboxes which run insecure code. @@ -1958,7 +1958,7 @@ rb_thread_safe_level(VALUE thread) /* * call-seq: - * thr.inspect => string + * thr.inspect -> string * * Dump the name, id, and status of _thr_ to a string. */ @@ -2000,7 +2000,7 @@ rb_thread_local_aref(VALUE thread, ID id) /* * call-seq: - * thr[sym] => obj or nil + * thr[sym] -> obj or nil * * Attribute Reference---Returns the value of a thread-local variable, using * either a symbol or a string name. If the specified variable does not exist, @@ -2050,7 +2050,7 @@ rb_thread_local_aset(VALUE thread, ID id, VALUE val) /* * call-seq: - * thr[sym] = obj => obj + * thr[sym] = obj -> obj * * Attribute Assignment---Sets or creates the value of a thread-local variable, * using either a symbol or a string. See also Thread#[]. @@ -2064,7 +2064,7 @@ rb_thread_aset(VALUE self, VALUE id, VALUE val) /* * call-seq: - * thr.key?(sym) => true or false + * thr.key?(sym) -> true or false * * Returns true if the given string (or symbol) exists as a * thread-local variable. @@ -2118,7 +2118,7 @@ rb_thread_alone(void) /* * call-seq: - * thr.keys => array + * thr.keys -> array * * Returns an an array of the names of the thread-local variables (as Symbols). * @@ -2145,7 +2145,7 @@ rb_thread_keys(VALUE self) /* * call-seq: - * thr.priority => integer + * thr.priority -> integer * * Returns the priority of thr. Default is inherited from the * current thread which creating the new thread, or zero for the @@ -2169,7 +2169,7 @@ rb_thread_priority(VALUE thread) /* * call-seq: - * thr.priority= integer => thr + * thr.priority= integer -> thr * * Sets the priority of thr to integer. Higher-priority threads * will run more frequently than lower-priority threads (but lower-priority @@ -2862,7 +2862,7 @@ thgroup_list_i(st_data_t key, st_data_t val, st_data_t data) /* * call-seq: - * thgrp.list => array + * thgrp.list -> array * * Returns an array of all existing Thread objects that belong to * this group. @@ -2885,7 +2885,7 @@ thgroup_list(VALUE group) /* * call-seq: - * thgrp.enclose => thgrp + * thgrp.enclose -> thgrp * * Prevents threads from being added to or removed from the receiving * ThreadGroup. New threads can still be started in an enclosed @@ -2915,7 +2915,7 @@ thgroup_enclose(VALUE group) /* * call-seq: - * thgrp.enclosed? => true or false + * thgrp.enclosed? -> true or false * * Returns true if thgrp is enclosed. See also * ThreadGroup#enclose. @@ -2935,7 +2935,7 @@ thgroup_enclosed_p(VALUE group) /* * call-seq: - * thgrp.add(thread) => thgrp + * thgrp.add(thread) -> thgrp * * Adds the given thread to this group, removing it from any other * group to which it may have previously belonged. @@ -3067,7 +3067,7 @@ mutex_alloc(VALUE klass) /* * call-seq: - * Mutex.new => mutex + * Mutex.new -> mutex * * Creates a new Mutex */ @@ -3085,7 +3085,7 @@ rb_mutex_new(void) /* * call-seq: - * mutex.locked? => true or false + * mutex.locked? -> true or false * * Returns +true+ if this lock is currently held by some thread. */ @@ -3111,7 +3111,7 @@ mutex_locked(rb_thread_t *th, VALUE self) /* * call-seq: - * mutex.try_lock => true or false + * mutex.try_lock -> true or false * * Attempts to obtain the lock and returns immediately. Returns +true+ if the * lock was granted. @@ -3186,7 +3186,7 @@ lock_interrupt(void *ptr) /* * call-seq: - * mutex.lock => self + * mutex.lock -> self * * Attempts to grab the lock and waits if it isn't available. * Raises +ThreadError+ if +mutex+ was locked by the current thread. @@ -3295,7 +3295,7 @@ mutex_unlock(mutex_t *mutex, rb_thread_t volatile *th) /* * call-seq: - * mutex.unlock => self + * mutex.unlock -> self * * Releases the lock. * Raises +ThreadError+ if +mutex+ wasn't locked by the current thread. @@ -3380,7 +3380,7 @@ rb_mutex_sleep(VALUE self, VALUE timeout) /* * call-seq: - * mutex.sleep(timeout = nil) => number + * mutex.sleep(timeout = nil) -> number * * Releases the lock and sleeps +timeout+ seconds if it is given and * non-nil or forever. Raises +ThreadError+ if +mutex+ wasn't locked by @@ -3397,7 +3397,7 @@ mutex_sleep(int argc, VALUE *argv, VALUE self) /* * call-seq: - * mutex.synchronize { ... } => result of the block + * mutex.synchronize { ... } -> result of the block * * Obtains a lock, runs the block, and releases the lock when the block * completes. See the example under +Mutex+. @@ -3883,8 +3883,8 @@ static void call_trace_func(rb_event_flag_t, VALUE data, VALUE self, ID id, VALU /* * call-seq: - * set_trace_func(proc) => proc - * set_trace_func(nil) => nil + * set_trace_func(proc) -> proc + * set_trace_func(nil) -> nil * * Establishes _proc_ as the handler for tracing, or disables * tracing if the parameter is +nil+. _proc_ takes up @@ -3953,7 +3953,7 @@ thread_add_trace_func(rb_thread_t *th, VALUE trace) /* * call-seq: - * thr.add_trace_func(proc) => proc + * thr.add_trace_func(proc) -> proc * * Adds _proc_ as a handler for tracing. * See Thread#set_trace_func and +set_trace_func+. @@ -3970,8 +3970,8 @@ thread_add_trace_func_m(VALUE obj, VALUE trace) /* * call-seq: - * thr.set_trace_func(proc) => proc - * thr.set_trace_func(nil) => nil + * thr.set_trace_func(proc) -> proc + * thr.set_trace_func(nil) -> nil * * Establishes _proc_ on _thr_ as the handler for tracing, or * disables tracing if the parameter is +nil+. @@ -4120,7 +4120,7 @@ VALUE rb_thread_backtrace(VALUE thval); /* * call-seq: - * thr.backtrace => array + * thr.backtrace -> array * * Returns the current back trace of the _thr_. */ -- cgit v1.2.3