replace pthread_spinlock_t into struct spinlock type