Mac + OpenMP + pthreads workaround: recent commit broke compile, just
moved it into threads.c now instead of having it duplicated in various places.
This commit is contained in:
@@ -100,13 +100,6 @@
|
||||
#define PR_XMAX 200
|
||||
#define PR_YMAX 195
|
||||
|
||||
#if defined(__APPLE__) && (PARALLEL == 1) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 2)
|
||||
/* ************** libgomp (Apple gcc 4.2.1) TLS bug workaround *************** */
|
||||
#include <pthread.h>
|
||||
extern pthread_key_t gomp_tls_key;
|
||||
static void *thread_tls_data;
|
||||
#endif
|
||||
|
||||
/* XXX */
|
||||
static int qtest() {return 0;}
|
||||
/* XXX */
|
||||
@@ -1105,11 +1098,6 @@ static void common_preview_startjob(void *customdata, short *stop, short *do_upd
|
||||
{
|
||||
ShaderPreview *sp= customdata;
|
||||
|
||||
#if defined(__APPLE__) && (PARALLEL == 1) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 2)
|
||||
// Workaround for Apple gcc 4.2.1 omp vs background thread bug
|
||||
pthread_setspecific (gomp_tls_key, thread_tls_data);
|
||||
#endif
|
||||
|
||||
if(sp->pr_method == PR_ICON_RENDER)
|
||||
icon_preview_startjob(customdata, stop, do_update);
|
||||
else
|
||||
@@ -1140,11 +1128,6 @@ void ED_preview_icon_job(const bContext *C, void *owner, ID *id, unsigned int *r
|
||||
WM_jobs_timer(steve, 0.1, NC_MATERIAL, NC_MATERIAL);
|
||||
WM_jobs_callbacks(steve, common_preview_startjob, NULL, NULL);
|
||||
|
||||
#if defined(__APPLE__) && (PARALLEL == 1) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 2)
|
||||
// Workaround for Apple gcc 4.2.1 omp vs background thread bug
|
||||
thread_tls_data = pthread_getspecific(gomp_tls_key);
|
||||
#endif
|
||||
|
||||
WM_jobs_start(CTX_wm_manager(C), steve);
|
||||
}
|
||||
|
||||
@@ -1171,11 +1154,6 @@ void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, M
|
||||
WM_jobs_timer(steve, 0.1, NC_MATERIAL, NC_MATERIAL);
|
||||
WM_jobs_callbacks(steve, common_preview_startjob, NULL, shader_preview_updatejob);
|
||||
|
||||
#if defined(__APPLE__) && (PARALLEL == 1) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 2)
|
||||
// Workaround for Apple gcc 4.2.1 omp vs background thread bug
|
||||
thread_tls_data = pthread_getspecific(gomp_tls_key);
|
||||
#endif
|
||||
|
||||
WM_jobs_start(CTX_wm_manager(C), steve);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user