Forum Discussion
Altera_Forum
Honored Contributor
21 years agoSemaphore support
Hi, I'm currently trying to initialize a semaphore by making a call to sem_init(), but instead of returning a non-zero value and printing a error condition, Nios II reboots. struct sem_...
Altera_Forum
Honored Contributor
21 years agoHi smcnutt,
I made some errors when I made my original post. When SemInit() is called something seems to get trashed and cause Nios to reboot:SemInit(myThreadName, &mySem, "mySemaphore"); void SemInit(char *who, sem_t *mSem, char *label)
{
printf("%s is initializing %s\n", who, label); // Debug message
if (sem_init(mSem, 0, 0) != 0)
printf("Failed when initializing semaphore.\n"); // Error message
printf("%s has initialized %s\n", who, label); // Debug message
return;
} I don't see either the debug or error messages displayed before the reboot. Thanks for your help.