Hi,

To understand the working of JNI and native library in Android, I have
a written a small sample native library with a method a method
displayHelloWorld() in which i acquired a mutex and write string
"hello" and "world" respectively to a log file. Each write is followed
by a flush().

I glued this library using the JNI so that my java application can
access the native library. I then wrote two sample application and
calling native library function displayHelloWorld().

The issue i am facing is, though i have acquired a mutex still
sometimes the logs are getting mixed up in the log file. Here is what
i am getting in the log :

[PID : 612] - hello
[PID : 613] - hello
[PID : 613] - world
[PID : 612] - world

Can anyone explain why is it so ?

Regards,
Gaurav

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to