wait of  nowait parameter added.

Hello.

If mutex is locked, switch to perform to wait or nowait.

Please add this modification.