Skip to content

Commit 19e3174

Browse files
committedJun 22, 2015
More locking fixes.
1 parent 915978c commit 19e3174

17 files changed

+60
-329
lines changed
 

‎vm/builtin/channel.cpp

-8
Original file line numberDiff line numberDiff line change
@@ -133,20 +133,12 @@ namespace rubinius {
133133
ts.tv_nsec = nano % NANOSECONDS;
134134
}
135135

136-
// We lock to manipulate the wait condition on the VM* so that
137-
// we can sync up properly with another thread trying to wake us
138-
// up right as we're trying to go to sleep.
139-
state->lock(gct, call_frame);
140-
141136
if(!state->check_async(call_frame)) {
142-
state->unlock();
143137
return NULL;
144138
}
145139

146140
state->vm()->wait_on_channel(self);
147141

148-
state->unlock();
149-
150142
self->waiters_++;
151143

152144
bool exception = false;

‎vm/builtin/compiled_code.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,6 @@ namespace rubinius {
204204
Object* CompiledCode::default_executor(STATE, CallFrame* call_frame,
205205
Executable* exec, Module* mod, Arguments& args)
206206
{
207-
LockableScopedLock lg(state, &state->shared(), __FILE__, __LINE__);
208-
209207
CompiledCode* code = as<CompiledCode>(exec);
210208
if(code->execute == default_executor) {
211209
const char* reason = 0;
@@ -223,8 +221,6 @@ namespace rubinius {
223221
}
224222
}
225223

226-
lg.unlock();
227-
228224
return code->execute(state, call_frame, exec, mod, args);
229225
}
230226

‎vm/gc/managed.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ namespace rubinius {
1212

1313
ManagedThread::ManagedThread(uint32_t id, SharedState& ss,
1414
ManagedThread::Kind kind, const char* name)
15-
: Lockable(true)
16-
, shared_(ss)
15+
: shared_(ss)
1716
, run_state_(eIndependent)
1817
, kind_(kind)
1918
, os_thread_(pthread_self())

‎vm/gc/managed.hpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include "gc/variable_buffer.hpp"
66
#include "gc/root_buffer.hpp"
77
#include "gc/root.hpp"
8-
#include "lock.hpp"
98
#include "metrics.hpp"
109

1110
#include <algorithm>
@@ -19,7 +18,7 @@ namespace rubinius {
1918

2019
typedef std::vector<ObjectHeader*> LockedObjects;
2120

22-
class ManagedThread : public Lockable {
21+
class ManagedThread {
2322
public:
2423
// WorldState sets the run_state_ directly.
2524
friend class WorldState;

‎vm/global_cache.hpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace rubinius {
1818

1919
typedef std_unordered_set<native_int> SeenMethodSet;
2020

21-
class GlobalCache : public Lockable {
21+
class GlobalCache {
2222
public:
2323
struct CacheEntry {
2424
Module* klass;
@@ -44,9 +44,7 @@ namespace rubinius {
4444
static bool resolve(STATE, Symbol* name, Dispatch& msg, LookupData& lookup);
4545
bool resolve_i(STATE, Symbol* name, Dispatch& msg, LookupData& lookup);
4646

47-
GlobalCache()
48-
: Lockable(true)
49-
{
47+
GlobalCache() {
5048
reset();
5149
}
5250

‎vm/internal_threads.hpp

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#ifndef RBX_AUXILIARY_THREADS_H
22
#define RBX_AUXILIARY_THREADS_H
33

4-
#include "lock.hpp"
5-
64
#include "util/thread.hpp"
75

86
#include <string>

‎vm/lock.cpp

-22
This file was deleted.

‎vm/lock.hpp

-240
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.