Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/llfio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'include/llfio/v2.0')
-rw-r--r--include/llfio/v2.0/detail/impl/dynamic_thread_pool_group.ipp27
-rw-r--r--include/llfio/v2.0/detail/impl/reduce.ipp6
2 files changed, 23 insertions, 10 deletions
diff --git a/include/llfio/v2.0/detail/impl/dynamic_thread_pool_group.ipp b/include/llfio/v2.0/detail/impl/dynamic_thread_pool_group.ipp
index 08e6762e..4192306c 100644
--- a/include/llfio/v2.0/detail/impl/dynamic_thread_pool_group.ipp
+++ b/include/llfio/v2.0/detail/impl/dynamic_thread_pool_group.ipp
@@ -458,7 +458,7 @@ namespace detail
bool done = false;
for(dynamic_thread_pool_group::work_item *p = nullptr, *n = next_timer_relative.front; n != nullptr; p = n, n = n->_next_scheduled)
{
- if(n->_timepoint1 <= i->_timepoint1)
+ if(n->_timepoint1 > i->_timepoint1)
{
if(p == nullptr)
{
@@ -480,6 +480,21 @@ namespace detail
i->_next_scheduled = nullptr;
next_timer_relative.back = i;
}
+#if 0
+ {
+ auto now = std::chrono::steady_clock::now();
+ std::cout << "\n";
+ for(dynamic_thread_pool_group::work_item *p = nullptr, *n = next_timer_relative.front; n != nullptr; p = n, n = n->_next_scheduled)
+ {
+ if(p != nullptr)
+ {
+ assert(n->_timepoint1 >= p->_timepoint1);
+ }
+ std::cout << "\nRelative timer: " << std::chrono::duration_cast<std::chrono::milliseconds>(n->_timepoint1 - now).count();
+ }
+ std::cout << std::endl;
+ }
+#endif
}
next_timer_relative.lock.unlock();
}
@@ -496,7 +511,7 @@ namespace detail
bool done = false;
for(dynamic_thread_pool_group::work_item *p = nullptr, *n = next_timer_absolute.front; n != nullptr; p = n, n = n->_next_scheduled)
{
- if(n->_timepoint2 <= i->_timepoint2)
+ if(n->_timepoint2 > i->_timepoint2)
{
if(p == nullptr)
{
@@ -1151,8 +1166,12 @@ namespace detail
{
if(d.steady)
{
- workitem->_timepoint1 = std::chrono::steady_clock::now() + std::chrono::nanoseconds(d.nsecs);
- workitem->_timepoint2 = {};
+ std::chrono::microseconds diff(d.nsecs / 1000);
+ if(diff > std::chrono::microseconds(0))
+ {
+ workitem->_timepoint1 = std::chrono::steady_clock::now() + diff;
+ workitem->_timepoint2 = {};
+ }
}
else
{
diff --git a/include/llfio/v2.0/detail/impl/reduce.ipp b/include/llfio/v2.0/detail/impl/reduce.ipp
index 5ce27e3b..1ed837cd 100644
--- a/include/llfio/v2.0/detail/impl/reduce.ipp
+++ b/include/llfio/v2.0/detail/impl/reduce.ipp
@@ -64,8 +64,6 @@ namespace algorithm
0x20 /*FILE_SYNCHRONOUS_IO_NONALERT*/ | 0x00200000 /*FILE_OPEN_REPARSE_POINT*/ | 0x00001000 /*FILE_DELETE_ON_CLOSE*/ | 0x040 /*FILE_NON_DIRECTORY_FILE*/;
const DWORD deletedir_ntflags =
0x20 /*FILE_SYNCHRONOUS_IO_NONALERT*/ | 0x00200000 /*FILE_OPEN_REPARSE_POINT*/ | 0x00001000 /*FILE_DELETE_ON_CLOSE*/ | 0x01 /*FILE_DIRECTORY_FILE*/;
- const DWORD renamefile_ntflags = 0x20 /*FILE_SYNCHRONOUS_IO_NONALERT*/ | 0x00200000 /*FILE_OPEN_REPARSE_POINT*/ | 0x040 /*FILE_NON_DIRECTORY_FILE*/;
- const DWORD renamedir_ntflags = 0x20 /*FILE_SYNCHRONOUS_IO_NONALERT*/ | 0x00200000 /*FILE_OPEN_REPARSE_POINT*/ | 0x01 /*FILE_DIRECTORY_FILE*/;
IO_STATUS_BLOCK isb = make_iostatus();
path_view::c_str<> zpath(leafname, path_view::zero_terminated);
UNICODE_STRING _path{};
@@ -172,10 +170,6 @@ namespace algorithm
using namespace windows_nt_kernel;
const DWORD access = SYNCHRONIZE | DELETE;
const DWORD fileshare = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE;
- const DWORD deletefile_ntflags =
- 0x20 /*FILE_SYNCHRONOUS_IO_NONALERT*/ | 0x00200000 /*FILE_OPEN_REPARSE_POINT*/ | 0x00001000 /*FILE_DELETE_ON_CLOSE*/ | 0x040 /*FILE_NON_DIRECTORY_FILE*/;
- const DWORD deletedir_ntflags =
- 0x20 /*FILE_SYNCHRONOUS_IO_NONALERT*/ | 0x00200000 /*FILE_OPEN_REPARSE_POINT*/ | 0x00001000 /*FILE_DELETE_ON_CLOSE*/ | 0x01 /*FILE_DIRECTORY_FILE*/;
const DWORD renamefile_ntflags = 0x20 /*FILE_SYNCHRONOUS_IO_NONALERT*/ | 0x00200000 /*FILE_OPEN_REPARSE_POINT*/ | 0x040 /*FILE_NON_DIRECTORY_FILE*/;
const DWORD renamedir_ntflags = 0x20 /*FILE_SYNCHRONOUS_IO_NONALERT*/ | 0x00200000 /*FILE_OPEN_REPARSE_POINT*/ | 0x01 /*FILE_DIRECTORY_FILE*/;
IO_STATUS_BLOCK isb = make_iostatus();