Does anyone know the best way to lock a semaphore in an SMP system? How do I avoid the problem of two processors running the lock code simultaneously and in sync?