pthread locking and unlocking

When more than one thread is waiting for a locked mutex, which thread will be granted the lock first after it is released.

In our application we want to implement FIFO thread scheduling policy i.e. Thread should get lock which one requested first for it.AIX have SCHED_FIFO thread scheduling policy but did not worked, i have added code snap shots below with output.