# oscP5, can't draw shapes from inside the oscEvent function

**URL:** <https://discourse.processing.org/t/oscp5-cant-draw-shapes-from-inside-the-oscevent-function/26309>\
**Category:** Libraries\
**Created:** [December 16, 2020, 8:04pm UTC](https://discourse.processing.org/t/oscp5-cant-draw-shapes-from-inside-the-oscevent-function/26309 "2020-12-16T20:04:40Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [December 16, 2020, 8:30pm UTC](https://discourse.processing.org/t/oscp5-cant-draw-shapes-from-inside-the-oscevent-function/26309/2 "2020-12-16T20:30:03Z")

</div>

> [@adamstephensun](#):
>
> When I call this function from outside the **oscEvent function()**, it works as is intended.

> [@Stumped by something simple](https://discourse.processing.org/t/stumped-by-something-simple/10057/9):
>
> Even though Processing enqueues input events in a separate Thread, it dequeues them in the main “Animation” Thread. So it’s safe to “draw” when using Processing’s own input callbacks. Now, if a 3rd-party library deals w/ hardware, its callbacks got a very high chance to happen in a separate Thread. Therefore, it’s highly unsafe to mutate the main canvas under a separate Thread. In order to find out which Thread is executing a method, just place this statement there: println(Thread.currentTh…

---

_[View the full topic](https://discourse.processing.org/t/oscp5-cant-draw-shapes-from-inside-the-oscevent-function/26309)._
