# Ccall of a thread C function from REPL

**URL:** <https://discourse.julialang.org/t/ccall-of-a-thread-c-function-from-repl/65845>\
**Category:** General Usage\
**Created:** [August 4, 2021, 10:32pm UTC](https://discourse.julialang.org/t/ccall-of-a-thread-c-function-from-repl/65845 "2021-08-04T22:32:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lecrapouille](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lecrapouille/32/24071_2.png) [@Lecrapouille](https://discourse.julialang.org/u/Lecrapouille)\
**Post date:** [August 4, 2021, 10:32pm UTC](https://discourse.julialang.org/t/ccall-of-a-thread-c-function-from-repl/65845/1 "2021-08-04T22:32:44Z")

</div>

Hello,

I’ve made a standalone GUI application in C++ and I can call it from Julia REPL. To achieve this, I exported a C function named `int entry_point()` calling the GUI which loops for ever until the user close the window. I compiled this function as a shared library.

```julia
julia> ccall((:entry_point, "/usr/lib/libmyapplication.so"), Int, ())
0

```

This is working well, but I have no longer access to the REPL and I want to extend the API of my GUI application to allow me to return some result that I can exploit from the REPL, something like this:

```julia
julia> handle = ccall(...)

... the gui is working ...

julia> foo = my_function(handle)
result

... the gui is working ...

```

For the moment, I do not know how to thread my entry\_point function. If I call std::thread without calling join() the REPL will crash. Is there a good way to tell Julia to thread my ccall and let me access to the REPL ?

Thanks
