Unfortunately the code is not correct because the global variable is declared as shared. And this implies that the class must be synchronized.

As a consequence this is not compatible with vibe.d fibers since we should use vibe.d friendly fibers. The variable increment was a dummy operation for example. In practice it could be an operation doing blocking calls.