[haiku-bugs] Re: [Haiku] #14738: [pc_serial] Sometimes gets stuck in Write() (even in async mode)

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Mon, 03 Dec 2018 13:27:32 -0000

#14738: [pc_serial] Sometimes gets stuck in Write() (even in async mode)
-------------------------------+----------------------------
   Reporter:  ttcoder          |      Owner:  pulkomandy
       Type:  bug              |     Status:  assigned
   Priority:  normal           |  Milestone:  Unscheduled
  Component:  Kits/Device Kit  |    Version:  R1/Development
 Resolution:                   |   Keywords:
 Blocked By:                   |   Blocking:
Has a Patch:  0                |   Platform:  All
-------------------------------+----------------------------

Comment (by ttcoder):

 Running {{{ps}}}, he gets this:

 {{{
 /boot/home/config/apps/TuneTrackerSystems/CommandCenter   589        7
 0    0
   Thread                                   Id    State Prio    UTime
 KTime
 CommandCenter                           589     wait   10  1294940
 340328
 event_server                            607     wait   10    85438
 30826 SwitcherHandler_looper(3464)
 logging_server                          608     wait   10    17937
 8280
 render                                  610      zzz   15  1514434
 1373240
 w>Command Center                        618     wait   15   953315
 243675
 SwitcherHandler_looper                  624     wait   10   222743
 178693 pc_serial:done_write(3480)
 }}}

 Looking for "pc_serial:done_write" yields this:
 http://xref.plausible.coop/source/xref/haiku/src/add-
 ons/kernel/drivers/ports/pc_serial/SerialDevice.cpp

 From my limited understanding, it seems the semaphore is acquired in
 Write() and released in WriteCallbackFunction() ? So the fact my thread
 remains stuck means the callback was not called, does that sound correct?
 How do I deal with that in my app, can I "unblock" my thread from another
 thread ?

-- 
Ticket URL: <https://dev.haiku-os.org/ticket/14738#comment:1>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: