forked from nasa/osal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix nasa#1252, add implementation of condition variable API
Adds a complete implementation of condition variables for POSIX. Includes coverage and unit tests. RTEMS and VxWorks will temporarily use a "no-condvar" placeholder until an implementation for those systems is added.
- Loading branch information
Showing
38 changed files
with
2,351 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/************************************************************************ | ||
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” | ||
* | ||
* Copyright (c) 2020 United States Government as represented by the | ||
* Administrator of the National Aeronautics and Space Administration. | ||
* All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. You may obtain | ||
* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
************************************************************************/ | ||
|
||
/** | ||
* \file os-impl-no-condvar.c | ||
* \author joseph.p.hickey@nasa.gov | ||
* | ||
* Purpose: All functions return OS_ERR_NOT_IMPLEMENTED. | ||
* This is used when network functionality is disabled by config. | ||
*/ | ||
|
||
/**************************************************************************************** | ||
INCLUDE FILES | ||
***************************************************************************************/ | ||
|
||
#include <osapi.h> | ||
#include "os-shared-condvar.h" | ||
|
||
int32 OS_CondVarCreate_Impl(const OS_object_token_t *token, uint32 options) | ||
{ | ||
return OS_ERR_NOT_IMPLEMENTED; | ||
} | ||
|
||
int32 OS_CondVarLock_Impl(const OS_object_token_t *token) | ||
{ | ||
return OS_ERR_NOT_IMPLEMENTED; | ||
} | ||
|
||
int32 OS_CondVarUnlock_Impl(const OS_object_token_t *token) | ||
{ | ||
return OS_ERR_NOT_IMPLEMENTED; | ||
} | ||
|
||
int32 OS_CondVarSignal_Impl(const OS_object_token_t *token) | ||
{ | ||
return OS_ERR_NOT_IMPLEMENTED; | ||
} | ||
|
||
int32 OS_CondVarBroadcast_Impl(const OS_object_token_t *token) | ||
{ | ||
return OS_ERR_NOT_IMPLEMENTED; | ||
} | ||
|
||
int32 OS_CondVarWait_Impl(const OS_object_token_t *token) | ||
{ | ||
return OS_ERR_NOT_IMPLEMENTED; | ||
} | ||
|
||
int32 OS_CondVarTimedWait_Impl(const OS_object_token_t *token, const OS_time_t *abs_wakeup_time) | ||
{ | ||
return OS_ERR_NOT_IMPLEMENTED; | ||
} | ||
|
||
int32 OS_CondVarDelete_Impl(const OS_object_token_t *token) | ||
{ | ||
return OS_ERR_NOT_IMPLEMENTED; | ||
} | ||
|
||
int32 OS_CondVarGetInfo_Impl(const OS_object_token_t *token, OS_condvar_prop_t *condvar_prop) | ||
{ | ||
return OS_ERR_NOT_IMPLEMENTED; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/************************************************************************ | ||
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” | ||
* | ||
* Copyright (c) 2020 United States Government as represented by the | ||
* Administrator of the National Aeronautics and Space Administration. | ||
* All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. You may obtain | ||
* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
************************************************************************/ | ||
|
||
/** | ||
* \file | ||
* | ||
* \ingroup posix | ||
* | ||
*/ | ||
|
||
#ifndef OS_IMPL_CONDVAR_H | ||
#define OS_IMPL_CONDVAR_H | ||
|
||
#include "osconfig.h" | ||
#include <pthread.h> | ||
|
||
/* CondVares */ | ||
typedef struct | ||
{ | ||
pthread_mutex_t mut; | ||
pthread_cond_t cv; | ||
} OS_impl_condvar_internal_record_t; | ||
|
||
/* Tables where the OS object information is stored */ | ||
extern OS_impl_condvar_internal_record_t OS_impl_condvar_table[OS_MAX_CONDVARS]; | ||
|
||
#endif /* OS_IMPL_CONDVAR_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.