Changeset 2935 in webkit for trunk/JavaScriptCore/kjs


Ignore:
Timestamp:
Dec 4, 2002, 4:12:34 PM (22 years ago)
Author:
mjs
Message:

Reviewed by: Richard Williamson

Added explicit lock/unlock methods so Sherlock can grab the
interpreter lock as needed.

  • kjs/internal.cpp: (InterpreterImp::InterpreterImp): (InterpreterImp::lock): (InterpreterImp::unlock):
  • kjs/internal.h:
  • kjs/interpreter.cpp: (Interpreter::lock): (Interpreter::unlock):
  • kjs/interpreter.h:
Location:
trunk/JavaScriptCore/kjs
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/internal.cpp

    r2883 r2935  
    7070};
    7171
    72 #if APPLE_CHANGES
    7372static pthread_once_t interpreterLockOnce = PTHREAD_ONCE_INIT;
    7473static pthread_mutex_t interpreterLock;
     
    9594}
    9695
    97 #endif
    9896
    9997
     
    504502  // add this interpreter to the global chain
    505503  // as a root set for garbage collection
    506 #if APPLE_CHANGES
    507504  lockInterpreter();
    508505  m_interpreter = interp;
    509 #endif
    510506  if (s_hook) {
    511507    prev = s_hook;
     
    518514    globalInit();
    519515  }
    520 #if APPLE_CHANGES
    521516  unlockInterpreter();
    522 #endif
    523 
    524 #if !APPLE_CHANGES
    525   m_interpreter = interp;
    526 #endif
     517
    527518  global = glob;
    528519  globExec = new ExecState(m_interpreter,0);
     
    534525
    535526  recursion = 0;
     527}
     528
     529void InterpreterImp::lock()
     530{
     531  lockInterpreter();
     532}
     533
     534void InterpreterImp::unlock()
     535{
     536  unlockInterpreter();
    536537}
    537538
  • trunk/JavaScriptCore/kjs/internal.h

    r2821 r2935  
    224224
    225225    void initGlobalObject();
     226    static void lock();
     227    static void unlock();
    226228
    227229    void mark();
  • trunk/JavaScriptCore/kjs/interpreter.cpp

    r2851 r2935  
    9090}
    9191
     92void Interpreter::lock()
     93{
     94  InterpreterImp::lock();
     95}
     96
     97void Interpreter::unlock()
     98{
     99  InterpreterImp::unlock();
     100}
     101
    92102ExecState *Interpreter::globalExec()
    93103{
  • trunk/JavaScriptCore/kjs/interpreter.h

    r2851 r2935  
    146146    void initGlobalObject();
    147147
     148    static void lock();
     149    static void unlock();
     150
    148151    /**
    149152     * Returns the execution state object which can be used to execute
     
    211214     */
    212215    Object builtinArray() const;
    213 
    214216
    215217    /**
Note: See TracChangeset for help on using the changeset viewer.