WordPress at a glance
function is not described

wp_set_post_lock() WP 2.5.0

Mark the post as currently being edited by the current user

No Hooks.

Return

Array/false. Array of the lock time and user ID. False if the post does not exist, or there is no current user.

Usage

wp_set_post_lock( $post_id );
$post_id(int) (required)
ID of the post being edited.

Code of wp set post lock: wp-admin/includes/post.php VER 5.1.1

<?php
function wp_set_post_lock( $post_id ) {
	if ( ! $post = get_post( $post_id ) ) {
		return false;
	}

	if ( 0 == ( $user_id = get_current_user_id() ) ) {
		return false;
	}

	$now  = time();
	$lock = "$now:$user_id";

	update_post_meta( $post->ID, '_edit_lock', $lock );

	return array( $now, $user_id );
}