void LoadThreadsUnload() { Harness::LIBRARY_HANDLE lib = Harness::OpenLibrary(TEST_LIBRARY_NAME("test_malloc_used_by_lib_dll")); ASSERT(lib, "Can't load " TEST_LIBRARY_NAME("test_malloc_used_by_lib_dll")); NativeParallelFor( 4, UseDll( Harness::GetAddress(lib, "callDll") ) ); Harness::CloseLibrary(lib); }
void operator()(int id) const { if (!id) { Harness::LIBRARY_HANDLE lib = Harness::OpenLibrary(TEST_LIBRARY_NAME("test_malloc_used_by_lib_dll")); ASSERT(lib, "Can't load " TEST_LIBRARY_NAME("test_malloc_used_by_lib_dll")); runPtr = Harness::GetAddress(lib, "callDll"); unloadCallback.lib = lib; } startBarr.wait(); (*runPtr)(); endBarr.wait(unloadCallback); }
/*override*/ task* execute() { if( n<2 ) { result = n; } else { // TODO: why RTLD_LAZY was used here? Harness::LIBRARY_HANDLE hLib = Harness::OpenLibrary(TEST_LIBRARY_NAME("test_cilk_dynamic_load_dll")); CilkFib = (CILK_CALL)Harness::GetAddress(hLib, "CilkFib"); CilkShutdown = (CILK_SHUTDOWN)Harness::GetAddress(hLib, "CilkShutdown"); int x, y; x = CilkFib(n-2); y = CilkFib(n-1); result = x+y; CilkShutdown(); Harness::CloseLibrary(hLib); } return NULL; }