diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2020-02-13 14:18:53 +0100 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2020-02-15 18:09:30 +0100 |
commit | 6f4d85d2150c287432f7696659f22eeca0a0e1b2 (patch) | |
tree | 26c62c4d3e5c9ef68fe1fca006e3db9a18093f59 | |
parent | 6546c3f4a1d140024cb2ab2c90fbf192749a1bf7 (diff) |
Cleanup: block processor: remove delayed thread notification
Under the assumption that block processing is CPU bound and not I/O
bound, this is entirely useless.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r-- | lib/sqfs/block_processor/fileapi.c | 9 | ||||
-rw-r--r-- | lib/sqfs/block_processor/internal.h | 4 | ||||
-rw-r--r-- | lib/sqfs/block_processor/serial.c | 4 | ||||
-rw-r--r-- | lib/sqfs/block_processor/winpthread.c | 7 |
4 files changed, 7 insertions, 17 deletions
diff --git a/lib/sqfs/block_processor/fileapi.c b/lib/sqfs/block_processor/fileapi.c index dee1d5e..ac73a51 100644 --- a/lib/sqfs/block_processor/fileapi.c +++ b/lib/sqfs/block_processor/fileapi.c @@ -22,10 +22,7 @@ static int enqueue_block(sqfs_block_processor_t *proc, sqfs_block_t *block) return status; } - if (proc->backlog == proc->max_backlog) - proc->notify_threads = true; - - return append_to_work_queue(proc, block, proc->notify_threads); + return append_to_work_queue(proc, block); } static int add_sentinel_block(sqfs_block_processor_t *proc) @@ -174,7 +171,7 @@ int sqfs_block_processor_finish(sqfs_block_processor_t *proc) { int status = 0; - append_to_work_queue(proc, NULL, true); + append_to_work_queue(proc, NULL); while (proc->backlog > 0) { status = wait_completed(proc); @@ -183,7 +180,7 @@ int sqfs_block_processor_finish(sqfs_block_processor_t *proc) } if (proc->frag_block != NULL) { - status = append_to_work_queue(proc, proc->frag_block, true); + status = append_to_work_queue(proc, proc->frag_block); proc->frag_block = NULL; if (status) diff --git a/lib/sqfs/block_processor/internal.h b/lib/sqfs/block_processor/internal.h index 71f8fab..4fd2728 100644 --- a/lib/sqfs/block_processor/internal.h +++ b/lib/sqfs/block_processor/internal.h @@ -82,7 +82,6 @@ struct sqfs_block_processor_t { sqfs_compressor_t *cmp; sqfs_block_t *frag_block; - bool notify_threads; sqfs_block_writer_t *wr; sqfs_block_processor_stats_t stats; @@ -128,8 +127,7 @@ SQFS_INTERNAL int test_and_set_status(sqfs_block_processor_t *proc, int status); SQFS_INTERNAL -int append_to_work_queue(sqfs_block_processor_t *proc, sqfs_block_t *block, - bool notify_threads); +int append_to_work_queue(sqfs_block_processor_t *proc, sqfs_block_t *block); SQFS_INTERNAL int wait_completed(sqfs_block_processor_t *proc); diff --git a/lib/sqfs/block_processor/serial.c b/lib/sqfs/block_processor/serial.c index 469388c..9c21950 100644 --- a/lib/sqfs/block_processor/serial.c +++ b/lib/sqfs/block_processor/serial.c @@ -44,11 +44,9 @@ int test_and_set_status(sqfs_block_processor_t *proc, int status) return proc->status; } -int append_to_work_queue(sqfs_block_processor_t *proc, sqfs_block_t *block, - bool signal_threads) +int append_to_work_queue(sqfs_block_processor_t *proc, sqfs_block_t *block) { sqfs_block_t *fragblk = NULL; - (void)signal_threads; if (proc->status != 0 || block == NULL) { free(block); diff --git a/lib/sqfs/block_processor/winpthread.c b/lib/sqfs/block_processor/winpthread.c index a91f001..6d7c843 100644 --- a/lib/sqfs/block_processor/winpthread.c +++ b/lib/sqfs/block_processor/winpthread.c @@ -288,8 +288,7 @@ fail_init: } #endif -int append_to_work_queue(sqfs_block_processor_t *proc, sqfs_block_t *block, - bool signal_threads) +int append_to_work_queue(sqfs_block_processor_t *proc, sqfs_block_t *block) { int status; @@ -312,9 +311,7 @@ int append_to_work_queue(sqfs_block_processor_t *proc, sqfs_block_t *block, block = NULL; } out: - if (signal_threads) - SIGNAL_ALL(&proc->queue_cond); - + SIGNAL_ALL(&proc->queue_cond); UNLOCK(&proc->mtx); free(block); return 0; |