tdf#151073 - enable firebird for appstore build w/o experimental mode
[LibreOffice.git] / include / osl / conditn.h
blobb39167a2dd4bfaadcb0e9fa713ba020d04a2b769
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 * This file is part of LibreOffice published API.
24 #ifndef INCLUDED_OSL_CONDITN_H
25 #define INCLUDED_OSL_CONDITN_H
27 #include "sal/config.h"
29 #include "osl/time.h"
30 #include "sal/saldllapi.h"
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
36 typedef void* oslCondition;
38 typedef enum {
39 osl_cond_result_ok, /*<! Successful completion. */
40 osl_cond_result_error, /*<! Error occurred. @see osl_getLastSocketError() */
41 osl_cond_result_timeout, /*<! Blocking operation timed out. */
42 osl_cond_result_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
43 } oslConditionResult;
45 /** Creates a condition.
47 @deprecated use C++11's std::condition_variable instead
48 for a more robust and helpful condition.
50 The condition is in the reset-state.
52 @retval osl_cond_result_error Condition could not be created.
54 SAL_DLLPUBLIC oslCondition SAL_CALL osl_createCondition(void);
56 /** Free the memory used by the condition.
58 @param Condition the condition handle.
60 SAL_DLLPUBLIC void SAL_CALL osl_destroyCondition(oslCondition Condition);
62 /** Sets condition to True => wait() will not block, check() returns True.
64 @attention @em all threads waiting on this condition are unblocked!
66 @param Condition handle to a created condition.
67 @retval False if system-call failed.
69 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_setCondition(oslCondition Condition);
71 /** Sets condition to False => wait() will block, check() returns False
73 @param Condition handle to a created condition.
74 @retval False if system-call failed.
76 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_resetCondition(oslCondition Condition);
78 /** Blocks if condition is not set.
80 @param Condition handle to a created condition.
81 @param pTimeout Timeout value or NULL for infinite waiting
82 @retval False Condition has been destroyed prematurely or system call has failed.
84 SAL_DLLPUBLIC oslConditionResult SAL_CALL osl_waitCondition(oslCondition Condition, const TimeValue* pTimeout);
86 /** Queries the state of the condition without blocking.
88 @param Condition handle to a created condition.
90 @retval True condition is set
91 @retval False condition is not set
93 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_checkCondition(oslCondition Condition);
95 #ifdef __cplusplus
97 #endif
99 #endif // INCLUDED_OSL_CONDITN_H
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */