mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=4439
This commit is contained in:
parent
7c2217f679
commit
f6171de1bd
|
@ -119,14 +119,22 @@ void BOINC_OPTIONS::defaults() {
|
||||||
options.direct_process_action = true;
|
options.direct_process_action = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// this is called ONLY by the worker thread
|
// the following 2 functions are used when there's no graphics
|
||||||
//
|
//
|
||||||
int boinc_init() {
|
int boinc_init() {
|
||||||
options.defaults();
|
options.defaults();
|
||||||
return boinc_init_options(options);
|
return boinc_init_options(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
int boinc_init_options(BOINC_OPTIONS& opt) {
|
int boinc_init_options(BOINC_OPTIONS& opt) {
|
||||||
|
int retval;
|
||||||
|
retval = boinc_init_options_general(opt);
|
||||||
|
if (retval) return retval;
|
||||||
|
return set_worker_timer();
|
||||||
|
}
|
||||||
|
|
||||||
|
// the following can be called by either graphics or worker thread
|
||||||
|
//
|
||||||
|
int boinc_init_options_general(BOINC_OPTIONS& opt) {
|
||||||
int retval;
|
int retval;
|
||||||
options = opt;
|
options = opt;
|
||||||
|
|
||||||
|
@ -193,8 +201,6 @@ int boinc_init_options(BOINC_OPTIONS& opt) {
|
||||||
heartbeat_active = !standalone;
|
heartbeat_active = !standalone;
|
||||||
heartbeat_giveup_time = dtime() + HEARTBEAT_GIVEUP_PERIOD;
|
heartbeat_giveup_time = dtime() + HEARTBEAT_GIVEUP_PERIOD;
|
||||||
|
|
||||||
set_worker_timer();
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,6 +92,7 @@ extern APP_CLIENT_SHM *app_client_shm;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
extern HANDLE worker_thread_handle;
|
extern HANDLE worker_thread_handle;
|
||||||
#endif
|
#endif
|
||||||
|
extern int boinc_init_options_general(BOINC_OPTIONS& opt);
|
||||||
extern int set_worker_timer();
|
extern int set_worker_timer();
|
||||||
|
|
||||||
/////////// IMPLEMENTATION STUFF ENDS HERE
|
/////////// IMPLEMENTATION STUFF ENDS HERE
|
||||||
|
|
|
@ -62,19 +62,17 @@ bool graphics_inited = false;
|
||||||
|
|
||||||
static void (*worker_main)();
|
static void (*worker_main)();
|
||||||
|
|
||||||
static BOINC_OPTIONS goptions;
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// glue routine for Windows
|
// glue routine for Windows
|
||||||
DWORD WINAPI foobar(LPVOID) {
|
DWORD WINAPI foobar(LPVOID) {
|
||||||
boinc_init_options(goptions);
|
set_worker_timer();
|
||||||
worker_main();
|
worker_main();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef _PTHREAD_H
|
#ifdef _PTHREAD_H
|
||||||
void* foobar(void*) {
|
void* foobar(void*) {
|
||||||
boinc_init_options(goptions);
|
set_worker_timer();
|
||||||
worker_main();
|
worker_main();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -83,11 +81,11 @@ void* foobar(void*) {
|
||||||
int boinc_init_graphics(void (*worker)()) {
|
int boinc_init_graphics(void (*worker)()) {
|
||||||
BOINC_OPTIONS opt;
|
BOINC_OPTIONS opt;
|
||||||
opt.defaults();
|
opt.defaults();
|
||||||
boinc_init_options_graphics(opt, worker);
|
return boinc_init_options_graphics(opt, worker);
|
||||||
}
|
}
|
||||||
|
|
||||||
int boinc_init_graphics_options(BOINC_OPTIONS& opt, void (*_worker_main)()) {
|
int boinc_init_options_graphics(BOINC_OPTIONS& opt, void (*_worker_main)()) {
|
||||||
goptions = opt;
|
boinc_init_options_general(opt);
|
||||||
worker_main = _worker_main;
|
worker_main = _worker_main;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#ifndef BOINC_GRAPHICS_API_H
|
#ifndef BOINC_GRAPHICS_API_H
|
||||||
#define BOINC_GRAPHICS_API_H
|
#define BOINC_GRAPHICS_API_H
|
||||||
|
|
||||||
|
struct BOINC_OPTIONS;
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
extern int boinc_init_graphics(void (*worker)());
|
extern int boinc_init_graphics(void (*worker)());
|
||||||
extern int boinc_init_options_graphics(BOINC_OPTIONS&, void (*worker)());
|
extern int boinc_init_options_graphics(BOINC_OPTIONS&, void (*worker)());
|
||||||
|
|
|
@ -18900,3 +18900,10 @@ Rom 26 Oct 2004 (boinc)
|
||||||
- Tag for 4.52 release, all platforms
|
- Tag for 4.52 release, all platforms
|
||||||
boinc_core_release_4_52
|
boinc_core_release_4_52
|
||||||
|
|
||||||
|
|
||||||
|
David 26 Oct 2004
|
||||||
|
- Further changes to graphics API
|
||||||
|
|
||||||
|
api/
|
||||||
|
boinc_api.C,h
|
||||||
|
graphics_api.C
|
||||||
|
|
Loading…
Reference in New Issue