mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-25 15:39:27 -05:00
added error message when thread creation fails
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4112 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
5028b749e6
commit
6edee55e57
@ -27,6 +27,8 @@
|
|||||||
|
|
||||||
#include "rsthreads.h"
|
#include "rsthreads.h"
|
||||||
#include <unistd.h> /* for usleep() */
|
#include <unistd.h> /* for usleep() */
|
||||||
|
#include <errno.h> /* for usleep() */
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
/*******
|
/*******
|
||||||
* #define DEBUG_THREADS 1
|
* #define DEBUG_THREADS 1
|
||||||
@ -71,8 +73,12 @@ pthread_t createThread(RsThread &thread)
|
|||||||
pthread_create(&tid, &tattr, &rsthread_init, data);
|
pthread_create(&tid, &tattr, &rsthread_init, data);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pthread_create(&tid, 0, &rsthread_init, data);
|
int err ;
|
||||||
thread.mTid = tid;
|
|
||||||
|
if( 0 == (err=pthread_create(&tid, 0, &rsthread_init, data)))
|
||||||
|
thread.mTid = tid;
|
||||||
|
else
|
||||||
|
std::cerr << "Fatal error: pthread_create could not create a thread. Error returned: " << err << " !!!!!!!" << std::endl;
|
||||||
}
|
}
|
||||||
thread.mMutex.unlock();
|
thread.mMutex.unlock();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user