Am Dienstag, 30. Mai 2006 09:51 schrieb Jonas Maebe: > On 30 mei 2006, at 08:57, Marco van de Voort wrote: > >> This is not that easy: Is it only for UP or maybe also for SMP > >> machines? > >> Basically, for x86 the "cli" and "sti" asm instructions do > >> disable/ enable interrupts, but read about it before you try. > >> Currently, I do such stuff only inside a driver (Linux kernel: > >> spin_lock, or win98 vxd: cli/sti) and don't know about any user > >> space function for this. > > > > FreeBSD has (in pthread.h): > > int pthread_spin_init(pthread_spinlock_t *, int); > > int pthread_spin_destroy(pthread_spinlock_t *); > > int pthread_spin_lock(pthread_spinlock_t *); > > int pthread_spin_trylock(pthread_spinlock_t *); > > int pthread_spin_unlock(pthread_spinlock_t *); > > Those (fortunately) do not disable interrupts. I can't imagine that > any (generic) pre-emptively multitasked OS would allow a user space > program to disable interrupts.
exactly what I thought .. Burkhard _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal