Skip to content

Commit

Permalink
iox-eclipse-iceoryx#1391 Rename 'scheduler.hpp' to 'posix_scheduler.h…
Browse files Browse the repository at this point in the history
…pp' and move to new location
  • Loading branch information
elBoberido committed Nov 29, 2023
1 parent 2699a3b commit 39ac74a
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 13 deletions.
2 changes: 2 additions & 0 deletions doc/website/release-notes/iceoryx-unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -1266,3 +1266,5 @@
// after
IOX_POSIX_CALL(open)("/hypnotoad");
```

57. `iox::posix::getSchedulerPriorityMinimum` and `iox::posix::getSchedulerPriorityMaximum` has become internal API
2 changes: 2 additions & 0 deletions iceoryx_hoofs/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ cc_library(
"posix/ipc/source/*.cpp",
"posix/sync/source/*.cpp",
"posix/time/source/*.cpp",
"posix/utility/source/*.cpp",
"posix/vocabulary/source/*.cpp",
"primitives/source/*.cpp",
"reporting/source/log/building_blocks/*.cpp",
Expand Down Expand Up @@ -75,6 +76,7 @@ cc_library(
"posix/ipc/include/",
"posix/sync/include/",
"posix/time/include/",
"posix/utility/include/",
"posix/vocabulary/include/",
"primitives/include/",
"reporting/include/",
Expand Down
5 changes: 4 additions & 1 deletion iceoryx_hoofs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ iox_add_library(
${PROJECT_SOURCE_DIR}/posix/filesystem/include
${PROJECT_SOURCE_DIR}/posix/sync/include
${PROJECT_SOURCE_DIR}/posix/time/include
${PROJECT_SOURCE_DIR}/posix/utility/include
${PROJECT_SOURCE_DIR}/posix/vocabulary/include

${CMAKE_BINARY_DIR}/generated/iceoryx_hoofs/include
Expand All @@ -89,7 +90,9 @@ iox_add_library(
posix/design/include/
posix/ipc/include/
posix/filesystem/include/
posix/sync/include/
posix/time/include/
posix/utility/include/
posix/vocabulary/include/
FILES
design/source/functional_interface.cpp
Expand All @@ -104,7 +107,6 @@ iox_add_library(
source/cxx/requires.cpp
source/error_handling/error_handler.cpp
source/error_handling/error_handling.cpp
source/posix_wrapper/scheduler.cpp
source/posix_wrapper/shared_memory_object.cpp
source/posix_wrapper/shared_memory_object/memory_map.cpp
source/posix_wrapper/shared_memory_object/shared_memory.cpp
Expand All @@ -128,6 +130,7 @@ iox_add_library(
posix/sync/source/unnamed_semaphore.cpp
posix/time/source/adaptive_wait.cpp
posix/time/source/deadline_timer.cpp
posix/utility/source/posix_scheduler.cpp
posix/vocabulary/source/file_name.cpp
posix/vocabulary/source/file_path.cpp
posix/vocabulary/source/group_name.cpp
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_hoofs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ The module structure is a logical grouping. It is replicated for `concurrent` an
|`system_configuration` | i | Collection of free functions which acquire system information like the page-size. |
|`UniqueId` | i | Monotonic increasing IDs within a process. |
|`into` | i | |
|`Scheduler` | i | Supported schedulers and functions to get their priority range are contained here. |

### Primitives (primitives)

Expand Down Expand Up @@ -126,7 +127,6 @@ The module structure is a logical grouping. It is replicated for `concurrent` an
|`PeriodicTask` | i | Periodically executes a callable specified by the template parameter in a configurable time interval. |
|`smart_lock` | i | Creates arbitrary thread-safe constructs which then can be used like smart pointers. If some STL type should be thread safe use the smart_lock to create the thread safe version in one line. Based on some ideas presented in [Wrapping C++ Member Function Calls](https://stroustrup.com/wrapper.pdf) |
|`mutex` | i | Mutex interface, see [ManPage pthread_mutex_lock](https://man7.org/linux/man-pages/man3/pthread_mutex_lock.3p.html). |
|`Scheduler` | | Supported schedulers and functions to get their priority range are contained here. |
|`UnnamedSemaphore` | | Unamed semaphore interface, see [ManPage sem_overview](https://man7.org/linux/man-pages/man7/sem_overview.7.html) |
|`NamedSemaphore` | | Named semaphore interface, see [ManPage sem_overview](https://man7.org/linux/man-pages/man7/sem_overview.7.html) |
|`thread` | | Heap-less replacement for `std::thread`. |
Expand Down
6 changes: 3 additions & 3 deletions iceoryx_hoofs/posix/sync/source/mutex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// SPDX-License-Identifier: Apache-2.0

#include "iox/mutex.hpp"
#include "iceoryx_hoofs/posix_wrapper/scheduler.hpp"
#include "iox/detail/posix_scheduler.hpp"
#include "iox/logging.hpp"
#include "iox/posix_call.hpp"

Expand Down Expand Up @@ -155,8 +155,8 @@ struct MutexAttributes
return err(MutexCreationError::PRIORITIES_UNSUPPORTED_BY_PLATFORM);
case EINVAL:
{
auto minimumPriority = posix::getSchedulerPriorityMinimum(posix::Scheduler::FIFO);
auto maximumPriority = posix::getSchedulerPriorityMaximum(posix::Scheduler::FIFO);
auto minimumPriority = detail::getSchedulerPriorityMinimum(detail::Scheduler::FIFO);
auto maximumPriority = detail::getSchedulerPriorityMaximum(detail::Scheduler::FIFO);

IOX_LOG(ERROR,
"The priority ceiling \"" << priorityCeiling << "\" is not in the valid priority range [ "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@
// limitations under the License.
//
// SPDX-License-Identifier: Apache-2.0
#ifndef IOX_HOOFS_POSIX_WRAPPER_SCHEDULER_HPP
#define IOX_HOOFS_POSIX_WRAPPER_SCHEDULER_HPP

#ifndef IOX_HOOFS_POSIX_UTILITY_POSIX_SCHEDULER_HPP
#define IOX_HOOFS_POSIX_UTILITY_POSIX_SCHEDULER_HPP

#include "iceoryx_platform/sched.hpp"

#include <cstdint>

namespace iox
{
namespace posix
namespace detail
{
/// @brief Defines all supported scheduler
enum class Scheduler : int32_t
Expand All @@ -39,7 +40,7 @@ int32_t getSchedulerPriorityMinimum(const Scheduler scheduler) noexcept;
/// @param[in] scheduler the scheduler which is queried
/// @return The maximum priority of the scheduler
int32_t getSchedulerPriorityMaximum(const Scheduler scheduler) noexcept;
} // namespace posix
} // namespace detail
} // namespace iox

#endif
#endif // IOX_HOOFS_POSIX_UTILITY_POSIX_SCHEDULER_HPP
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
//
// SPDX-License-Identifier: Apache-2.0

#include "iceoryx_hoofs/posix_wrapper/scheduler.hpp"
#include "iox/detail/posix_scheduler.hpp"
#include "iceoryx_hoofs/cxx/requires.hpp"
#include "iox/logging.hpp"
#include "iox/posix_call.hpp"

namespace iox
{
namespace posix
namespace detail
{
int32_t getSchedulerPriorityMinimum(const Scheduler scheduler) noexcept
{
Expand Down Expand Up @@ -60,5 +60,5 @@ int32_t getSchedulerPriorityMaximum(const Scheduler scheduler) noexcept
}
return result.value().value;
}
} // namespace posix
} // namespace detail
} // namespace iox

0 comments on commit 39ac74a

Please sign in to comment.