Home » U++ Library support » U++ MT-multithreading and servers » ARM threadind does not work
Re: ARM threadind does not work [message #38443 is a reply to message #38440] |
Sat, 15 December 2012 22:20   |
Didier
Messages: 736 Registered: November 2008 Location: France
|
Contributor |
|
|
Ok, I found a correction,
The correction only shows where the problem is: incorrect management of 'sMutexLock' initialization by several threads at the same time
A clean correction is still to be found : I think a refactoring of StaticMutex will be necessary for this (the correction is only valid for POSIX systems)
This is not the first time Upp stumbles on the same problem : there is another case stated on the forum:
http://www.ultimatepp.org/forum/index.php?t=msg&goto=159 98&&srch=sMutexLock#msg_15998
Core/Mt.cpp L14
BEFORE:
static Mutex& sMutexLock()
{
static Mutex *section=0;
if(!section) {
static byte b[sizeof(Mutex)];
section = new(b) Mutex;
}
return *section;
}
AFTER
static Mutex *_sMutexLock_section=0;
static void _sMutexLock()
{
if(!_sMutexLock_section) {
static byte b[sizeof(Mutex)];
_sMutexLock_section = new(b) Mutex;
}
}
static Mutex& sMutexLock()
{
static pthread_once_t sMutexLock_is_initialized = PTHREAD_ONCE_INIT;
(void) pthread_once(&sMutexLock_is_initialized, _sMutexLock);
return *_sMutexLock_section;
}
[Updated on: Sat, 15 December 2012 22:25] Report message to a moderator
|
|
|
 |
|
ARM threadind does not work
By: Didier on Sat, 15 December 2012 11:00
|
 |
|
Re: ARM threadind does not work
By: Didier on Sat, 15 December 2012 18:16
|
 |
|
Re: ARM threadind does not work
By: Didier on Sat, 15 December 2012 22:20
|
 |
|
Re: ARM threadind does not work
By: Didier on Tue, 18 December 2012 21:46
|
 |
|
Re: ARM threadind does not work
By: mirek on Fri, 28 December 2012 11:59
|
 |
|
Re: ARM threadind does not work
By: Didier on Fri, 28 December 2012 14:40
|
 |
|
Re: ARM threadind does not work
By: Novo on Mon, 31 December 2012 07:16
|
 |
|
Re: ARM threadind does not work
By: Didier on Mon, 31 December 2012 12:09
|
 |
|
Re: ARM threadind does not work
By: Zbych on Mon, 31 December 2012 12:42
|
 |
|
Re: ARM threadind does not work
By: Didier on Tue, 01 January 2013 10:55
|
Goto Forum:
Current Time: Wed Aug 27 11:55:12 CEST 2025
Total time taken to generate the page: 0.06236 seconds
|