when using (int) instead, this may work on 32-bit platforms, (sizeof int == 4 == sizeof unsigned long), but will
lead to memory corruption on 64-bit platforms (sizeof(int)==4, sizeof(long==8)). luckily the alignment error made this issue visible. it would be better to use appropriate locking types for this, though.
when using (int) instead, this may work on 32-bit platforms, (sizeof int == 4 == sizeof unsigned long), but will lead to memory corruption on 64-bit platforms (sizeof(int)==4, sizeof(long==8)). luckily the alignment error made this issue visible. it would be better to use appropriate locking types for this, though.
This fixes #14.