1. 25 Sep, 2010 1 commit
    • Thomas Jansen's avatar
      eliminate g_error() usage · 28bcb8bd
      Thomas Jansen authored
      Replaced all occurrences of g_error() with MPD_ERROR() located in a new header
      file 'mpd_error.h'. This macro uses g_critical() to print the error message
      and then exits gracefully in contrast to g_error() which would internally call
      abort() to produce a core dump.
      
      The macro name is distinctive and allows to find all places with dubious error
      handling. The long-term goal is to get rid of MPD_ERROR() altogether. To
      facilitate the eventual removal of this macro it was added in a new header
      file rather than to an existing header file.
      
      This fixes #2995 and #3007.
      28bcb8bd
  2. 23 Sep, 2010 1 commit
    • Denis Krjuchkov's avatar
      main: Add Windows Service support · e8ebb1af
      Denis Krjuchkov authored
      I've added PIPE_EVENT_SHUTDOWN because calling g_main_loop_quit() do not work when called from another thread.
      Main thread was sleeping in g_poll() so I needed some way to wake it up.
      
      By some strange reason call close(event_pipe[0]) in event_pipe_deinit() hangs.
      In current implementation that code never reached so that was not a problem :-)
      I've added a conditional to leave event_pipe[0] open on Win32.
      e8ebb1af
  3. 19 May, 2010 2 commits
  4. 01 Jan, 2010 1 commit
  5. 12 Nov, 2009 1 commit
    • Max Kellermann's avatar
      include config.h in all sources · 5b82ffc2
      Max Kellermann authored
      After we've been hit by Large File Support problems several times in
      the past week (which only occur on 32 bit platforms, which I don't
      have), this is yet another attempt to fix the issue.
      5b82ffc2
  6. 08 Nov, 2009 1 commit
  7. 07 Nov, 2009 1 commit
    • Max Kellermann's avatar
      set the close-on-exec flag on all file descriptors · e3af0032
      Max Kellermann authored
      Added the "fd_util" library, which attempts to use the new thread-safe
      Linux system calls pipe2(), accept4() and the options O_CLOEXEC,
      SOCK_CLOEXEC.  Without these, it falls back to FD_CLOEXEC, which is
      not thread safe.
      
      This is particularly important for the "pipe" output plugin (and
      others, such as JACK/PulseAudio), because we were heavily leaking file
      descriptors to child processes.
      e3af0032
  8. 01 Apr, 2009 1 commit
    • Max Kellermann's avatar
      client, event_pipe: explicitly ignore the write() result · 8ce2ec7a
      Max Kellermann authored
      On both locations, the result of write() can be ignored safely.  In
      event_pipe_emit_fast(), that can only be "EAGAIN", which means that
      the pipe buffer is full - no further notification required.  In
      client_init(), that would be a fatal connection error, which would be
      caught by the next event.
      
      This patch fixes gcc warnings.
      8ce2ec7a
  9. 27 Mar, 2009 1 commit
  10. 13 Mar, 2009 1 commit
    • Avuton Olrich's avatar
      all: Update copyright header. · 0aee49bd
      Avuton Olrich authored
      This updates the copyright header to all be the same, which is
      pretty much an update of where to mail request for a copy of the GPL
      and the years of the MPD project. This also puts all committers under
      'The Music Player Project' umbrella. These entries should go
      individually in the AUTHORS file, for consistancy.
      0aee49bd
  11. 19 Feb, 2009 1 commit
  12. 10 Jan, 2009 1 commit
  13. 04 Jan, 2009 1 commit
  14. 03 Jan, 2009 5 commits
  15. 02 Jan, 2009 1 commit
  16. 01 Jan, 2009 4 commits
  17. 30 Dec, 2008 4 commits
    • Max Kellermann's avatar
      main_notify: removed lock()/unlock() · dd0f8e42
      Max Kellermann authored
      These functions are not used anymore since we use the GLib main loop.
      dd0f8e42
    • Max Kellermann's avatar
      main: use the GLib main loop · 71e7ce5d
      Max Kellermann authored
      This is a rather huge patch, which unfortunately cannot be splitted.
      
      Instead of using our custom ioops.h library, convert everything to use
      the GLib main loop.
      71e7ce5d
    • Max Kellermann's avatar
      main_notify: make the read side of the pipe blocking · 03e650aa
      Max Kellermann authored
      Currently, both sides of the pipe are blocking, although we do not
      need blocking read().  Convert it back to blocking.  Eliminate the
      select() from wait_main_task().
      03e650aa
    • Max Kellermann's avatar
      main_notify: removed notify object, use only pipe · 10b5966b
      Max Kellermann authored
      To wake up the main thread, don't attempt to use a GCond/GMutex
      (struct notify).  This kind of mixed wakeup method has known race
      conditions.
      
      The idea behind this patch is: for wakeups which happen while the main
      thread is sleeping, use only a pipe.  For wakeups which happen while
      the main thread is waiting for the player thread, we can later change
      to GCond.  For now, accept the overhead of using a pipe for the
      latter.
      
      In the long run, the main thread will never wait for the player
      thread, but will do everything asynchronously.
      10b5966b
  18. 28 Dec, 2008 1 commit
  19. 24 Nov, 2008 1 commit
  20. 08 Oct, 2008 2 commits
  21. 06 Oct, 2008 1 commit
  22. 26 Sep, 2008 1 commit
    • Max Kellermann's avatar
      notify: protect notify->pending with the mutex · 58554e14
      Max Kellermann authored
      There was a known deadlocking bug in the notify library: when the
      other thread set notify->pending after the according check in
      notify_wait(), the latter thread was deadlocked.  Resolve this by
      synchronizing all accesses to notify->pending with the notify object's
      mutex.  Since notify_signal_sync() was never used, we can remove it.
      As a consequence, we don't need notify_enter() and notify_leave()
      anymore; eliminate them, too.
      58554e14
  23. 24 Sep, 2008 1 commit
  24. 23 Sep, 2008 2 commits
  25. 26 Aug, 2008 1 commit
  26. 17 Apr, 2008 1 commit
    • Max Kellermann's avatar
      fix race condition in main_notify.c · 3c3620b3
      Max Kellermann authored
      The function wait_main_task() is racy: if the function
      wakeup_via_cond() sees the mutex is locked just before
      wait_main_task() executes pthread_cond_wait(), the main thread blocks
      forever.
      
      Work around this issue by adding a "pending" flag just like in my
      notify.c code.  A standards-compliant solution should be implemented
      later.
      
      git-svn-id: https://svn.musicpd.org/mpd/trunk@7365 09075e82-0dd4-0310-85a5-a0d7c8717e4f
      3c3620b3
  27. 13 Apr, 2008 1 commit