File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 7
7
#include < mutex.hpp>
8
8
#include < functional>
9
9
#include < string>
10
+ #include < thread.hpp>
10
11
11
12
namespace vfsn ::utility
12
13
{
@@ -69,6 +70,7 @@ namespace vfsn::utility
69
70
auto registerNotificationHandler (NotifyHandler hwnd) -> void
70
71
{
71
72
notificationCallback = hwnd;
73
+ threadHandle = hwnd ? cpp_freertos::Thread::GetCurrentThreadHandle () : nullptr ;
72
74
}
73
75
74
76
private:
@@ -80,7 +82,7 @@ namespace vfsn::utility
80
82
*/
81
83
auto notify (std::string_view file, FsEvent event, std::string_view old_file = " " ) -> void
82
84
{
83
- if (notificationCallback)
85
+ if (threadHandle != cpp_freertos::Thread::GetCurrentThreadHandle () && notificationCallback)
84
86
notificationCallback (file, event, old_file);
85
87
}
86
88
@@ -91,5 +93,6 @@ namespace vfsn::utility
91
93
cpp_freertos::MutexStandard mMutex ;
92
94
// ! Notification handler callback
93
95
NotifyHandler notificationCallback;
96
+ TaskHandle_t threadHandle;
94
97
};
95
98
} // namespace vfsn::utility
You can’t perform that action at this time.
0 commit comments