All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Problem with posix skin and Xenomai 2.1.0
@ 2006-04-03  9:17 Jens Niehaus
  2006-04-03 12:23 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 4+ messages in thread
From: Jens Niehaus @ 2006-04-03  9:17 UTC (permalink / raw)
  To: xenomai

Hi,

I am experiencing problems with xenomai 2.1.0 and pthread_mutex_init. The second initialization in the following program returns with a value of 16 (EBUSY). What is wrong with the code (or with xenomai)?

Thanks in advance,
	Jens


---------------------------------------
#include <pthread.h>
#include <stdio.h>

int main( int argc, char *argv[] )
{
	pthread_mutex_t m1;
	pthread_mutex_t m2;
	int ret;

	if ( (ret = pthread_mutex_init( &m1, NULL ) ) )
	{
		printf("First init failed, ret=%i\n", ret );
		return ret;
	}
	/* sleep(1); */
	if ( ( ret = pthread_mutex_init( &m2, NULL ) ) )
	{
		printf("Second init failed, ret=%i\n", ret );
		return ret;
	}
	printf("Done\n");
	return 0;
}
--------------------------------------

I am using xenomai 2.1.0 and kernel 2.6.15.7 compiled with gcc 3.3.5 (SuSE 9.3).

The program does work
- when using xenomai 2.1-rc2
- when compiling without xenomai
- when sleep(1) is inserted between the calls to pthread_mutex_init

The program does not work
- when using kernel 2.6.14.6
- with mutex initialization after pthread_setschedparam( pthread_self(), SCHED_FIFO, ... );
- with mutex initialization in a newly created, SCHED_FIFO enabled thread
- when using pthread_mutexattr_t structures for initialization
- on different processors: Athlon 64 2800+ (build system) and VIA Samuel 2 533Mhz (target system)


Here is some more information, which might be helpful:

root: cat /proc/cmdline
auto BOOT_IMAGE=xenomai rw root=100 init=/linuxrc ramdisk_size=8196 noapic noacpi noapm

root: grep /configure /usr/src/xenomai-build/config.log
  $ ../xenomai-2.1.0/configure --enable-x86-tsc --enable-debug

root: zcat /proc/config.gz|grep XENO |grep -v "not set"
CONFIG_XENOMAI=y
CONFIG_XENO_OPT_NUCLEUS=y
CONFIG_XENO_OPT_PERVASIVE=y
CONFIG_XENO_OPT_PIPE=y
CONFIG_XENO_OPT_PIPE_NRDEV=32
CONFIG_XENO_OPT_REGISTRY=y
CONFIG_XENO_OPT_REGISTRY_NRSLOTS=512
CONFIG_XENO_OPT_SYS_HEAPSZ=128
CONFIG_XENO_OPT_STATS=y
CONFIG_XENO_OPT_DEBUG=y
CONFIG_XENO_OPT_TIMING_PERIODIC=y
CONFIG_XENO_OPT_TIMING_PERIOD=0
CONFIG_XENO_OPT_TIMING_TIMERLAT=0
CONFIG_XENO_OPT_TIMING_SCHEDLAT=0
CONFIG_XENO_OPT_TIMER_LIST=y
CONFIG_XENO_HW_FPU=y
CONFIG_XENO_HW_SMI_DETECT=y
CONFIG_XENO_SKIN_NATIVE=y
CONFIG_XENO_OPT_NATIVE_PIPE=y
CONFIG_XENO_OPT_NATIVE_PIPE_BUFSZ=4096
CONFIG_XENO_OPT_NATIVE_SEM=y
CONFIG_XENO_OPT_NATIVE_EVENT=y
CONFIG_XENO_OPT_NATIVE_MUTEX=y
CONFIG_XENO_OPT_NATIVE_COND=y
CONFIG_XENO_OPT_NATIVE_QUEUE=y
CONFIG_XENO_OPT_NATIVE_HEAP=y
CONFIG_XENO_OPT_NATIVE_ALARM=y
CONFIG_XENO_OPT_NATIVE_MPS=y
CONFIG_XENO_SKIN_POSIX=y
CONFIG_XENO_SKIN_RTDM=y

Compilation:
gcc -g $(shell xeno-config --posix-cflags) mutextst.c $(shell xeno-config --posix-ldflags) -o mutextstxeno
gcc -g mutextst.c -lpthread -o mutextst


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-04-04  7:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-03  9:17 [Xenomai-help] Problem with posix skin and Xenomai 2.1.0 Jens Niehaus
2006-04-03 12:23 ` Gilles Chanteperdrix
2006-04-03 13:46   ` Jens Niehaus
2006-04-04  7:14   ` Jens Niehaus

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.