Cleanup: Re-organise source dir Re-organise the sources, add a top level "src" and "include" dir and move relevant files. Disable autotools automated includes and define them manually. This fixes problems with collision of header names with system headers. Include the autoconf config.h in the default includes and remove it where it's explicitely included. Remove _GNU_SOURCE defines since it's detected at configure for platforms that requires it and added to the config.h. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: add missing destroy functions to queues/stack APIs Queues and stack APIs that invoke pthread_mutex_init() should have a "destroy" counterpart which calls pthread_mutex_destroy(), ortherwise this causes small memory leaks on platforms where pthread_mutex_init performs memory allocation. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
wfstack: implement mutex-free wfstack with transparent union This allows users more freedom to use alternative synchronization mechanisms. Changes since v1: - Fix typos in cds_wfs_stack_ptr_t documentation. Thanks to Mathieu for spotting. Signed-off-by: Eric Wong <normalperson@yhbt.net> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Lai Jiangshan <laijs@cn.fujitsu.com> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
wfstack: return whether pop is popping the last element Newly introduced "with_state" pop API members return stack state atomically sampled with the pop operation. Allow testing behavior of pop with respect to number of push-to-empty and pop-all-from-non-empty. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
wfstack API: rename cds_wfs_first_blocking to cds_wfs_first cds_wfs_first never needs to block. This operation can be used to check if the stack returned by pop_all is empty or not, so it is quite interesting to have a fully non-blocking semantic for all of enqueue/pop_all/first operations. Only cds_wfs_next may block. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>