# Multithreading with lock

**URL:** https://discourse.julialang.org/t/multithreading-with-lock/84967
**Category:** New to Julia
**Created:** [July 29, 2022, 9:08am UTC](https://discourse.julialang.org/t/multithreading-with-lock/84967 "2022-07-29T09:08:35Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Brian1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/brian1/32/49250_2.png) [@Brian1](https://discourse.julialang.org/u/Brian1)
#### Post date: [July 29, 2022, 9:08am UTC](https://discourse.julialang.org/t/multithreading-with-lock/84967/1 "2022-07-29T09:08:35Z")

</div>

Is there a way I can get to know which of thread is using the `SpinLock`, which is locked by the thread.  
For example, there is a `l=SpinLock()`, and it is locked in threadid()=1. When the code runed into thread 2, how can I can get to know which thread locked the `l`? It seems `l.owned` does not works for this.
