(reposting from android-framework)
Hi all,
is the file descriptor in SensorManager.java global to all threads?
In setting up the event dispatch thread for sensor events, there is a
call
ParcelFileDescriptor fd = service.getDataChanel();
getDataChanel() eventually winds up calling open_data_source in the
sensor framework, which returns an open Linux fd. Then the code
instantiates a new thread with a SensorThreadRunnable, part of which
is here:
private class SensorThreadRunnable implements Runnable {
private ParcelFileDescriptor mSensorDataFd;
SensorThreadRunnable(ParcelFileDescriptor fd) {
mSensorDataFd = fd;
}
...
The run() method of SensorThreadRunnable later closes mSensorDataFd.
Does that close the original fd returned by getDataChanel? (i.e. is
the fd the same one in both threads, or are the semantics more like
dup
() because of the Parcel stuff?)
Thanks,
Hod
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting
-~----------~----~----~----~------~----~------~--~---