pthread_sleepon_timedwait at Strong Arm

Hallo everybody,

the following simple code works on x86 but not on arm.
Why not:
is annything wrong with the Code?
do I have buggy or to old armlibs?

Martin Binner
Software Development

E-Mail: m.binnerr@caa.de

#include <pthread.h>
#include <iostream.h>
#include <stdint.h>

int main(){
int i=0, iRetVal;
_uint64 Timeout=1000000000;
Timeout *=3;

cout<<“Start”<<endl;
pthread_sleepon_lock();
iRetVal= pthread_sleepon_timedwait((void*)i, Timeout);
switch (iRetVal){
case EADEADLK: cout<<“EADEADLK”<<endl; break;
case EOK: cout<<“EOK”<<endl; break;
case ETIMEOUT: cout<<“ETIMEOUT”<<endl; break;
default: cout<<iRetVal<<endl; break;
}
pthread_sleepon:unlock();
cout<<“Stop”<<endl;
}

I just tried this here on an assabet board and it worked as expected.
What version of the os are you using?

-Peter


Martin Binner <m.binner@caa.de> wrote:

Hallo everybody,

the following simple code works on x86 but not on arm.
Why not:
is annything wrong with the Code?
do I have buggy or to old armlibs?

Martin Binner
Software Development

E-Mail: > m.binnerr@caa.de

#include <pthread.h
#include <iostream.h
#include <stdint.h

int main(){
int i=0, iRetVal;
_uint64 Timeout=1000000000;
Timeout *=3;

cout<<“Start”<<endl;
pthread_sleepon_lock();
iRetVal= pthread_sleepon_timedwait((void*)i, Timeout);
switch (iRetVal){
case EADEADLK: cout<<“EADEADLK”<<endl; break;
case EOK: cout<<“EOK”<<endl; break;
case ETIMEOUT: cout<<“ETIMEOUT”<<endl; break;
default: cout<<iRetVal<<endl; break;
}
pthread_sleepon:unlock();
cout<<“Stop”<<endl;
}

I’m using QNX 6.1.0 with:

  • C/C++ Toolset for Targeting 1.1.0
  • Development (libs and headers) targeting 6.1.0

I just tried this here on an assabet board and it worked as expected.
What version of the os are you using?

-Peter


Martin Binner <> m.binner@caa.de> > wrote:
Hallo everybody,

the following simple code works on x86 but not on arm.
Why not:
is annything wrong with the Code?
do I have buggy or to old armlibs?

Martin Binner
Software Development

E-Mail: > m.binnerr@caa.de

#include <pthread.h
#include <iostream.h
#include <stdint.h

int main(){
int i=0, iRetVal;
_uint64 Timeout=1000000000;
Timeout *=3;

cout<<“Start”<<endl;
pthread_sleepon_lock();
iRetVal= pthread_sleepon_timedwait((void*)i, Timeout);
switch (iRetVal){
case EADEADLK: cout<<“EADEADLK”<<endl; break;
case EOK: cout<<“EOK”<<endl; break;
case ETIMEOUT: cout<<“ETIMEOUT”<<endl; break;
default: cout<<iRetVal<<endl; break;
}
pthread_sleepon:unlock();
cout<<“Stop”<<endl;
}