Загрузить файлы в «src»
This commit is contained in:
1 parent
1d50fb3c8f
commit
9ccb682234
3 files changed
+8
-3
No files matched your search
+6
-1
@@ -41,7 +41,12 @@ ps2000_status_t _ps2000_thr_create(pthread_t *thr, const char *name,
|
||||
pthread_attr_init(&attr);
|
||||
pthread_attr_setstacksize(&attr, 1024 * 1024); /* 1MB stack */
|
||||
|
||||
int ret = pthread_create(thr, &attr, _ps2000_thr_trampoline, (void*)&func);
|
||||
_ps2000_thr_ctx_t *thr_ctx = (_ps2000_thr_ctx_t*)malloc(sizeof(_ps2000_thr_ctx_t));
|
||||
if (!thr_ctx) { pthread_attr_destroy(&attr); return PS2000_ERR_MEMORY; }
|
||||
thr_ctx->func = func;
|
||||
thr_ctx->arg = arg;
|
||||
int ret = pthread_create(thr, &attr, _ps2000_thr_trampoline, thr_ctx);
|
||||
if (ret != 0) free(thr_ctx);
|
||||
pthread_attr_destroy(&attr);
|
||||
|
||||
if (ret != 0) {
|
||||
|
||||
Reference in new issue
Block a user