Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
More locking fixes.
  • Loading branch information
brixen committed Jun 22, 2015
1 parent 915978c commit 19e3174
Show file tree
Hide file tree
Showing 17 changed files with 60 additions and 329 deletions.
8 changes: 0 additions & 8 deletions vm/builtin/channel.cpp
Expand Up @@ -133,20 +133,12 @@ namespace rubinius {
ts.tv_nsec = nano % NANOSECONDS;
}

// We lock to manipulate the wait condition on the VM* so that
// we can sync up properly with another thread trying to wake us
// up right as we're trying to go to sleep.
state->lock(gct, call_frame);

if(!state->check_async(call_frame)) {
state->unlock();
return NULL;
}

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

state->unlock();

self->waiters_++;

bool exception = false;
Expand Down
4 changes: 0 additions & 4 deletions vm/builtin/compiled_code.cpp
Expand Up @@ -204,8 +204,6 @@ namespace rubinius {
Object* CompiledCode::default_executor(STATE, CallFrame* call_frame,
Executable* exec, Module* mod, Arguments& args)
{
LockableScopedLock lg(state, &state->shared(), __FILE__, __LINE__);

CompiledCode* code = as<CompiledCode>(exec);
if(code->execute == default_executor) {
const char* reason = 0;
Expand All @@ -223,8 +221,6 @@ namespace rubinius {
}
}

lg.unlock();

return code->execute(state, call_frame, exec, mod, args);
}

Expand Down
3 changes: 1 addition & 2 deletions vm/gc/managed.cpp
Expand Up @@ -12,8 +12,7 @@ namespace rubinius {

ManagedThread::ManagedThread(uint32_t id, SharedState& ss,
ManagedThread::Kind kind, const char* name)
: Lockable(true)
, shared_(ss)
: shared_(ss)
, run_state_(eIndependent)
, kind_(kind)
, os_thread_(pthread_self())
Expand Down
3 changes: 1 addition & 2 deletions vm/gc/managed.hpp
Expand Up @@ -5,7 +5,6 @@
#include "gc/variable_buffer.hpp"
#include "gc/root_buffer.hpp"
#include "gc/root.hpp"
#include "lock.hpp"
#include "metrics.hpp"

#include <algorithm>
Expand All @@ -19,7 +18,7 @@ namespace rubinius {

typedef std::vector<ObjectHeader*> LockedObjects;

class ManagedThread : public Lockable {
class ManagedThread {
public:
// WorldState sets the run_state_ directly.
friend class WorldState;
Expand Down
6 changes: 2 additions & 4 deletions vm/global_cache.hpp
Expand Up @@ -18,7 +18,7 @@ namespace rubinius {

typedef std_unordered_set<native_int> SeenMethodSet;

class GlobalCache : public Lockable {
class GlobalCache {
public:
struct CacheEntry {
Module* klass;
Expand All @@ -44,9 +44,7 @@ namespace rubinius {
static bool resolve(STATE, Symbol* name, Dispatch& msg, LookupData& lookup);
bool resolve_i(STATE, Symbol* name, Dispatch& msg, LookupData& lookup);

GlobalCache()
: Lockable(true)
{
GlobalCache() {
reset();
}

Expand Down
2 changes: 0 additions & 2 deletions vm/internal_threads.hpp
@@ -1,8 +1,6 @@
#ifndef RBX_AUXILIARY_THREADS_H
#define RBX_AUXILIARY_THREADS_H

#include "lock.hpp"

#include "util/thread.hpp"

#include <string>
Expand Down
22 changes: 0 additions & 22 deletions vm/lock.cpp

This file was deleted.

240 changes: 0 additions & 240 deletions vm/lock.hpp

This file was deleted.

0 comments on commit 19e3174

Please sign in to comment.