[Interest] Detecting if the application is already running from another user account

Igor Mironchik igor.mironchik at gmail.com
Fri Jun 3 15:05:29 CEST 2016


Hi,

I think that better to solve this task with shared memory... You can 
look at the example in QtCreator sources (qtsingleapplication.cpp)

On 03.06.2016 15:54, Etienne Sandré-Chardonnal wrote:
> But how can I test if another app is already running with 
> QSystemSemaphore? I can set a semaphore with a single ressource 
> (initial value = 1) and lock it, but there is a single method aquire() 
> which blocks forever if the value is 0. So I can just make the second 
> process freeze forever until the first one exits.
>
> 2016-06-03 12:54 GMT+02:00 Nye <kshegunov at gmail.com 
> <mailto:kshegunov at gmail.com>>:
>
>     Hello,
>     Have you tried a system semaphore? It should work in this case as
>     far as I know.
>
>
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160603/68a01211/attachment.html>


More information about the Interest mailing list