зеркало из https://github.com/github/ruby.git
postscript about rb_mutex_sleep
Asked ko1 about the design. [ci skip]
This commit is contained in:
Родитель
ce54282b75
Коммит
0ea157136f
|
@ -463,8 +463,17 @@ VALUE rb_mutex_unlock(VALUE mutex);
|
|||
*
|
||||
* This function is called from `ConditionVariable#wait`. So it is not a
|
||||
* deprecated feature. However @shyouhei have never seen any similar mutex
|
||||
* primitive available in any other language than Ruby. Is this a right
|
||||
* design? Maybe isn't it too complex a primitive?
|
||||
* primitive available in any other languages than Ruby.
|
||||
*
|
||||
* EDIT: In 2021, @shyouhei asked @ko1 in person about this API. He answered
|
||||
* that it is his invention. The motivation behind its design is to eliminate
|
||||
* needs of condition variables as primitives. Unlike other languages, Ruby's
|
||||
* `ConditionVariable` class was written in pure-Ruby initially. We don't have
|
||||
* to implement machine-native condition variables in assembly each time we
|
||||
* port Ruby to a new architecture. This function made it possible. "I felt I
|
||||
* was a genius when this idea came to me", said @ko1.
|
||||
*
|
||||
* `rb_cConditionVariable` is now written in C for speed, though.
|
||||
*/
|
||||
VALUE rb_mutex_sleep(VALUE self, VALUE timeout);
|
||||
|
||||
|
|
|
@ -280,6 +280,7 @@ ALIASES =
|
|||
ALIASES += "alias{1}=Just another name of @ref \1"
|
||||
ALIASES += "old{1}=Old name of @ref \1.^^@deprecated Use @ref \1 instead.^^@ingroup deprecated_macros"
|
||||
ALIASES += "shyouhei=\@shyouhei"
|
||||
ALIASES += "ko1=\@ko1"
|
||||
|
||||
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
|
||||
# only. Doxygen will then generate output that is more tailored for C. For
|
||||
|
|
Загрузка…
Ссылка в новой задаче