コード例 #1
0
void *
dbgsysLoadLibrary(const char *name, char *err_buf, int err_buflen)
{
    void * result;
#ifdef NATIVE
    result = dlopen(name, RTLD_LAZY);
#else
    sysMonitorEnter(greenThreadSelf(), &_dl_lock);
    result = dlopen(name, RTLD_NOW);
    sysMonitorExit(greenThreadSelf(), &_dl_lock);
    /*
     * This is a bit of bulletproofing to catch the commonly occurring
     * problem of people loading a library which depends on libthread into
     * the VM.  thr_main() should always return -1 which means that libthread
     * isn't loaded.
     */
    if (thr_main() != -1) {
         VM_CALL(panic)("libthread loaded into green threads");
    }
#endif
    if (result == NULL) {
        (void)strncpy(err_buf, dlerror(), err_buflen-2);
        err_buf[err_buflen-1] = '\0';
    }
    return result;
}
コード例 #2
0
void dbgsysUnloadLibrary(void *handle)
{
#ifndef NATIVE
    sysMonitorEnter(greenThreadSelf(), &_dl_lock);
#endif
    (void)dlclose(handle);
#ifndef NATIVE
    sysMonitorExit(greenThreadSelf(), &_dl_lock);
#endif
}
コード例 #3
0
void
sysUnloadLibrary(void *handle)
{
#ifdef NEED_DL_LOCK
    sysMonitorEnter(sysThreadSelf(), &_dl_lock);
    dlclose(handle);
    sysMonitorExit(sysThreadSelf(), &_dl_lock);
#else
    dlclose(handle);
#endif
}
コード例 #4
0
void * dbgsysFindLibraryEntry(void *handle, const char *name)
{
    void * sym;
#ifndef NATIVE
    sysMonitorEnter(greenThreadSelf(), &_dl_lock);
#endif
    sym =  dlsym(handle, name);
#ifndef NATIVE
    sysMonitorExit(greenThreadSelf(), &_dl_lock);
#endif
    return sym;
}
コード例 #5
0
void *
sysFindLibraryEntry(void *handle, const char *name)
{
    void *sym;
#ifdef NEED_DL_LOCK
    sysMonitorEnter(sysThreadSelf(), &_dl_lock);
    sym = dlsym(handle, name);
    sysMonitorExit(sysThreadSelf(), &_dl_lock);
#else
    sym = dlsym(handle, name);
#endif
    return sym;
}
コード例 #6
0
ファイル: rcblkmgr.c プロジェクト: Maoni0/SlidingViewGC
static void _LockBlkMgr(sys_thread_t *thrd)
{
  sysMonitorEnter( thrd, blkvar.blkMgrMon );
}