mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-28 09:10:01 +02:00
setting shared mutex attribute for non blackfins
This commit is contained in:
parent
5c0dff29ed
commit
38cc365c01
@ -84,6 +84,9 @@ int sharedMemory_create(int port) {
|
|||||||
int sharedMemory_initialize() {
|
int sharedMemory_initialize() {
|
||||||
shm->version = SHM_VERSION;
|
shm->version = SHM_VERSION;
|
||||||
|
|
||||||
|
// powerpc, Nios and normal pc allows setting mutex attribute to shared
|
||||||
|
#if defined(EIGERD) || defined(GOTTHARD2D) || defined(MYTHEN3D) || \
|
||||||
|
defined(VIRTUAL)
|
||||||
pthread_mutexattr_t lockStatusAttribute;
|
pthread_mutexattr_t lockStatusAttribute;
|
||||||
if (pthread_mutexattr_init(&lockStatusAttribute) != 0) {
|
if (pthread_mutexattr_init(&lockStatusAttribute) != 0) {
|
||||||
LOG(logERROR,
|
LOG(logERROR,
|
||||||
@ -105,6 +108,15 @@ int sharedMemory_initialize() {
|
|||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// only blackfins cannot set mutex attribute (but it is shared by default)
|
||||||
|
#else
|
||||||
|
if (pthread_mutex_init(&(shm->lockStatus), NULL) != 0) {
|
||||||
|
LOG(logERROR, ("Failed to initialize pthread_mutex_t lockStatus for "
|
||||||
|
"shared memory\n"));
|
||||||
|
return FAIL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef EIGERD
|
#ifdef EIGERD
|
||||||
pthread_mutexattr_t lockLocalLinkAttribute;
|
pthread_mutexattr_t lockLocalLinkAttribute;
|
||||||
if (pthread_mutexattr_init(&lockLocalLinkAttribute) != 0) {
|
if (pthread_mutexattr_init(&lockLocalLinkAttribute) != 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user