1526fd984Sopenharmony_ci/* 2526fd984Sopenharmony_ci * Copyright (C) 2021 Huawei Device Co., Ltd. 3526fd984Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4526fd984Sopenharmony_ci * you may not use this file except in compliance with the License. 5526fd984Sopenharmony_ci * You may obtain a copy of the License at 6526fd984Sopenharmony_ci * 7526fd984Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8526fd984Sopenharmony_ci * 9526fd984Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10526fd984Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11526fd984Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12526fd984Sopenharmony_ci * See the License for the specific language governing permissions and 13526fd984Sopenharmony_ci * limitations under the License. 14526fd984Sopenharmony_ci */ 15526fd984Sopenharmony_ci 16526fd984Sopenharmony_ci#ifndef HKS_CONDITION_H 17526fd984Sopenharmony_ci#define HKS_CONDITION_H 18526fd984Sopenharmony_ci 19526fd984Sopenharmony_ci#include <stdint.h> 20526fd984Sopenharmony_ci 21526fd984Sopenharmony_ci// One-time condition struct, you CAN NOT reset it after notify or notify-all, 22526fd984Sopenharmony_ci// you can only create a new one. 23526fd984Sopenharmony_citypedef struct HksCondition HksCondition; 24526fd984Sopenharmony_ci 25526fd984Sopenharmony_ci#ifdef __cplusplus 26526fd984Sopenharmony_ciextern "C" { 27526fd984Sopenharmony_ci#endif 28526fd984Sopenharmony_ci 29526fd984Sopenharmony_ciHksCondition *HksConditionCreate(void); 30526fd984Sopenharmony_ci 31526fd984Sopenharmony_ciint32_t HksConditionWait(HksCondition *condition); 32526fd984Sopenharmony_ci 33526fd984Sopenharmony_ciint32_t HksConditionNotify(HksCondition *condition); 34526fd984Sopenharmony_ci 35526fd984Sopenharmony_ciint32_t HksConditionNotifyAll(HksCondition *condition); 36526fd984Sopenharmony_ci 37526fd984Sopenharmony_civoid HksConditionDestroy(HksCondition* condition); 38526fd984Sopenharmony_ci 39526fd984Sopenharmony_ci#ifdef __cplusplus 40526fd984Sopenharmony_ci} 41526fd984Sopenharmony_ci#endif 42526fd984Sopenharmony_ci#endif 43