Re: [PATCH] add device node locking possibility to dvbcore

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Obi,

Andreas Oberritter wrote:
> Hi Oliver,
> 
> Oliver Endriss wrote:
>> ts_bus_ctrl does a kind of reference counting.
>>
>> For readers:
>> - fe->ops.ts_bus_ctrl(fe,1) is called during open
>> - fe->ops.ts_bus_ctrl(fe,0) is called during close
>>
>> For the one and only writer:
>> - fe->ops.ts_bus_ctrl(fe,1) is called during open
>> - fe->ops.ts_bus_ctrl(fe,0) is called when the thread exits,
>>   usually after close
> 
> To properly lock the bridge, fe->ops.ts_bus_ctrl(fe, 1) must be called
> only when the first user opens the device and fe->ops.ts_bus_ctrl(fe, 0)
> must be called only when the last user closes the device.
> 
> I think that the option dvb_shutdown_timeout must be removed to fix the
> problem, where the frontend thread can be idle after close(). IMHO the
> thread should always be terminated when the last writer closes the
> device. The release function should then block until the thread really
> has terminated.

Why would you need the frontend thread to be idle ? If you want the
frontend thread to be idle, requiring shutdown timeout to disabled, then
i think it makes no sense. (I am not saying it wouldn't work, but that
is not a great option.)

Possibly, ts_bus_ctrl can be made to return frontend status based on the
frontend private semaphore, such that it is safe for other bus activities.


_______________________________________________
linux-dvb mailing list
linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux