diff options
author | Krzysztof Jackiewicz <k.jackiewicz@samsung.com> | 2015-08-27 12:44:16 +0200 |
---|---|---|
committer | Janusz Kozerski <j.kozerski@samsung.com> | 2015-09-08 14:12:36 +0200 |
commit | 8fc0b8fc2a814035dc9cf8c7e211dc3a8f74d11b (patch) | |
tree | 6f86a12ee0423d9b83eb5ca5f55bd20cb8dee129 /src/include | |
parent | ae4a130374e96d383e09571f2e098ef237e28418 (diff) | |
download | cert-checker-8fc0b8fc2a814035dc9cf8c7e211dc3a8f74d11b.tar.gz cert-checker-8fc0b8fc2a814035dc9cf8c7e211dc3a8f74d11b.tar.bz2 cert-checker-8fc0b8fc2a814035dc9cf8c7e211dc3a8f74d11b.zip |
Fixed synchronisation issues
[Problem] Production code mixed with test code. Poor readability.
Synchronisation issues.
[Solution] Synchronisation reimplemented. Test code separated from production
code.
[Verification] Run all test
Change-Id: Iea5ed2ce9f10a4cdac8994acf91809cd12050d69
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/cchecker/logic.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/include/cchecker/logic.h b/src/include/cchecker/logic.h index aa50388..b5f1c22 100644 --- a/src/include/cchecker/logic.h +++ b/src/include/cchecker/logic.h @@ -97,10 +97,15 @@ class Logic { void *logic_ptr) ); + void push_event(event_t event); + void process_all(void); void process_queue(void); - void process_event(const event_t &event); + virtual void process_event(const event_t &event); + + bool process_app(app_t& app); void process_buffer(void); + virtual void app_processed() {}; // for tests bool get_online(void) const; void set_online(bool online); @@ -108,7 +113,7 @@ class Logic { bool get_should_exit(void) const; void set_should_exit(void); - void call_ui(const app_t &app); + bool call_ui(const app_t &app); Queue m_queue; Certs m_certs; @@ -117,6 +122,8 @@ class Logic { bool m_was_setup_called; bool m_is_online; + // TODO: use m_queue for online events + bool m_is_online_enabled; std::condition_variable m_to_process; std::mutex m_mutex_cv; std::thread m_thread; |