diff --git a/file.c b/file.c index 373788b20682f7..17df41f4c05baa 100644 --- a/file.c +++ b/file.c @@ -5227,50 +5227,25 @@ rb_thread_flock(void *data) * call-seq: * flock(locking_constant) -> 0 or false * - * Locks or unlocks a file according to the given `locking_constant`, + * Locks or unlocks file +self+ according to the given `locking_constant`, * a bitwise OR of the values in the table below. * * Not available on all platforms. * * Returns `false` if `File::LOCK_NB` is specified and the operation would have blocked; * otherwise returns `0`. + * *
* - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Locking Constants
ConstantLockEffect
File::LOCK_EXExclusiveOnly one process may hold an exclusive lock for self at a time.
File::LOCK_NBNon-blocking - * No blocking; may be combined with other File::LOCK_SH or File::LOCK_EX - * using the bitwise OR operator |. - *
File::LOCK_SHSharedMultiple processes may each hold a shared lock for self at the same time.
File::LOCK_UNUnlockRemove an existing lock held by this process.
+ * | Constant | Lock | Effect + * |-----------------|--------------|------------------------------------------------------------------- + * | +File::LOCK_EX+ | Exclusive | Only one process may hold an exclusive lock for +self+ at a time. + * | +File::LOCK_NB+ | Non-blocking | No blocking; may be combined with +File::LOCK_SH+ or +File::LOCK_EX+ using the bitwise OR operator \|. + * | +File::LOCK_SH+ | Shared | Multiple processes may each hold a shared lock for +self+ at the same time. + * | +File::LOCK_UN+ | Unlock | Remove an existing lock held by this process. * *
+ * * Example: * * ```ruby