/*D
   MPI_Win_lock - Begin an RMA access epoch at the target process

Synopsis:
.vb
int MPI_Win_lock(int lock_type, int rank, int assert, MPI_Win win)
.ve

Input Parameters:
+ lock_type - either MPI_LOCK_EXCLUSIVE or MPI_LOCK_SHARED (state)
. rank - rank of locked window (non-negative integer)
. assert - program assertion (integer)
- win - window object (handle)

Notes:
The name of this routine is misleading.  In particular, this
routine need not block, except when the target process is the calling
process.

Implementations may restrict the use of RMA communication that is
synchronized
by lock calls to windows in memory allocated by 'MPI_Alloc_mem'. Locks can
be used portably only in such memory.

The 'assert' argument is used to indicate special conditions for the
fence that an implementation may use to optimize the 'MPI_Win_lock'
operation.  The value zero is always correct.  Other assertion values
may be or''ed together.  Assertions that are valid for 'MPI_Win_lock' are\:

. MPI_MODE_NOCHECK - no other process holds, or will attempt to acquire a
  conflicting lock, while the caller holds the window lock. This is useful
  when mutual exclusion is achieved by other means, but the coherence
  operations that may be attached to the lock and unlock calls are still
  required.

.N ThreadSafe

.N Fortran

.N Errors
.N MPI_SUCCESS
.N MPI_ERR_RANK
.N MPI_ERR_WIN
.N MPI_ERR_OTHER

D*/

