Revert "adding CountLatch"

This reverts commit 31c5f3dd4652a076a926a5a637358cf393dde5f4.

Revert "bugfix: must increment counter on task submission, not when task starts executing"

This reverts commit c8267b079910179e79e9945f700317fb836ea8bf.

Revert "Revert "optimized synchronization to work without busy loops""

This reverts commit 9229bc5c5d8d1c746be0b2a5b9b47ac48401cac4.

Revert "Revert "further cleanups""

This reverts commit f6eab2a755829b27d7044f6b31009b5785e4adb4.

bugfix: must increment counter on task submission, not when task starts executing