Ignore:
Timestamp:
Feb 23, 2008, 11:50:04 AM (17 years ago)
Author:
[email protected]
Message:

2008-02-23 Alexey Proskuryakov <[email protected]>

Reviewed by Darin.

Move basic threading support from WebCore to WTF.

File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/ThreadingGtk.cpp

    r30421 r30522  
    3232
    3333#include "HashMap.h"
    34 #include "Logging.h"
    3534
    3635#include <glib.h>
    3736
    3837namespace WebCore {
    39 
    40 struct FunctionWithContext {
    41     MainThreadFunction* function;
    42     void* context;
    43 };
    44 
    45 static gboolean callFunctionOnMainThread(gpointer data)
    46 {
    47     FunctionWithContext* functionWithContext = static_cast<FunctionWithContext*>(data);
    48     functionWithContext->function(functionWithContext->context);
    49     delete functionWithContext;
    50     return FALSE;
    51 }
    52 
    53 void callOnMainThread(MainThreadFunction* function, void* context)
    54 {
    55     ASSERT(function);
    56     FunctionWithContext* functionWithContext = new FunctionWithContext;
    57     functionWithContext->function = function;
    58     functionWithContext->context = context;
    59     g_timeout_add(0, callFunctionOnMainThread, functionWithContext);
    60 }
    6138
    6239void initializeThreading()
     
    128105
    129106    ThreadIdentifier threadID = establishIdentifierForThread(thread);
    130     LOG(Threading, "Created thread with thread id %u", threadID);
    131107    return threadID;
    132108}
Note: See TracChangeset for help on using the changeset viewer.