* Copyright (c) 2022 Huawei Technologies Co.,Ltd.
*
* GR is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
*
* http://license.coscl.org.cn/MulanPSL2
*
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
* -------------------------------------------------------------------------
*
* gr_latch.c
*
*
* IDENTIFICATION
* src/common/gr_latch.c
*
* -------------------------------------------------------------------------
*/
#include "gr_latch.h"
#include "cm_utils.h"
latch_statis_t g_latch_stat[LATCH_STAT_TYPE_COUNT] = {0};
void gr_latch_x(latch_t *latch)
{
cm_latch_x(latch, GR_DEFAULT_SESSIONID, NULL);
}
void gr_unlatch(latch_t *latch)
{
cm_unlatch(latch, NULL);
}
void gr_latch_x2(latch_t *latch, uint32_t sid)
{
cm_latch_x(latch, sid, NULL);
}
void gr_set_latch_extent(gr_latch_extent_t *latch_extent, uint16 stat, uint16 shared_count)
{
latch_extent->stat_bak = stat;
latch_extent->shared_count_bak = shared_count;
latch_extent->shared_sid_count_bak = latch_extent->shared_sid_count;
}