-
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.
Merge pull request #20 from toppers/mmap
fix #16
- Loading branch information
Showing
10 changed files
with
134 additions
and
60 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#ifndef _HAKO_SEM_HPP_ | ||
#define _HAKO_SEM_HPP_ | ||
|
||
#include "types/hako_types.hpp" | ||
|
||
namespace hako::utils::sem::flock { | ||
int32_t create(int32_t key); | ||
void destroy(int32_t sem_id); | ||
void master_lock(int32_t sem_id); | ||
void master_unlock(int32_t sem_id); | ||
void asset_down(int32_t sem_id, int32_t asset_id); | ||
void asset_up(int32_t sem_id, int32_t asset_id); | ||
} | ||
|
||
#endif /* _HAKO_SEM_HPP_ */ |
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,31 @@ | ||
#ifndef _HAKO_SHARED_MEMORY_MMAP_HPP_ | ||
#define _HAKO_SHARED_MEMORY_MMAP_HPP_ | ||
|
||
#include "types/hako_types.hpp" | ||
#include "utils/hako_share/hako_shared_memory.hpp" | ||
#include <map> | ||
|
||
namespace hako::utils { | ||
|
||
class HakoSharedMemoryMmap : public HakoSharedMemory { | ||
public: | ||
HakoSharedMemoryMmap() {} | ||
virtual ~HakoSharedMemoryMmap() {} | ||
|
||
virtual int32_t create_memory(int32_t key, int32_t size) override; | ||
virtual void* load_memory(int32_t key, int32_t size) override; | ||
|
||
virtual void* lock_memory(int32_t key) override; | ||
virtual void unlock_memory(int32_t key) override; | ||
virtual void destroy_memory(int32_t key) override; | ||
|
||
virtual int32_t get_semid(int32_t key) override; | ||
|
||
private: | ||
void* load_memory_shmid(int32_t key, int32_t shmid); | ||
std::map<int32_t, SharedMemoryInfoType> shared_memory_map_; | ||
}; | ||
} | ||
|
||
|
||
#endif /* _HAKO_SHARED_MEMORY_MMAP_HPP_ */ |
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
4 changes: 4 additions & 0 deletions
4
src/hako/utils/hako_share/impl/hako_shared_memory_factory.cpp
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