зеркало из https://github.com/github/ruby.git
prelude.rb: deprecate Thread.exclusive
* prelude.rb (Thread.exclusive): warn as deprecated. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
aa4ab1814d
Коммит
2069c9e031
|
@ -1,3 +1,7 @@
|
|||
Fri Nov 13 13:05:37 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* prelude.rb (Thread.exclusive): warn as deprecated.
|
||||
|
||||
Fri Nov 13 10:36:39 2015 Victor Nawothnig <Victor.Nawothnig@gmail.com>
|
||||
|
||||
* parse.y (new_unless): optimize constant condition for `unless`
|
||||
|
|
|
@ -8,6 +8,7 @@ class Thread
|
|||
# value of the block. A thread executing inside the exclusive section will
|
||||
# only block other threads which also use the Thread.exclusive mechanism.
|
||||
def self.exclusive
|
||||
warn "Thread.exclusive is deprecated, use Mutex", caller
|
||||
MUTEX_FOR_THREAD_EXCLUSIVE.synchronize{
|
||||
yield
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче