Skip to content
Snippets Groups Projects
  1. Jan 23, 2015
  2. Jan 14, 2015
  3. Jan 12, 2015
  4. Sep 19, 2014
  5. Sep 12, 2014
  6. Sep 11, 2014
  7. Sep 09, 2014
  8. Sep 05, 2014
  9. Sep 04, 2014
  10. Sep 03, 2014
    • Peter Hutterer's avatar
      doc/publican: stop excessive rebuilds · fb97550c
      Peter Hutterer authored and Pekka Paalanen's avatar Pekka Paalanen committed
      Traced down to the server/client target always rebuilding, causing a rebuild
      of everything else. Rework this so the target name is a file we actually
      produce and can check for a timestamp.
      
      Note: this also changes the generated file from the doxygen directory into the
      en-US publican path and renames it to (server|client)API.xml.tmp to avoid
      copying it into the xml output directory.
      fb97550c
  11. Aug 22, 2014
    • Pekka Paalanen's avatar
    • Marek Chalupa's avatar
      client: check for error in wl_display_read_events · 8c061d1b
      Marek Chalupa authored and Pekka Paalanen's avatar Pekka Paalanen committed
      
      This prevents from blocking shown in one display test. Also, it
      makes sense to not proceed further in the code of the function
      when an error ocurred.
      
      v2. set errno
          put note about the errno into wl_display_prepare_read doc
          check for error with mutex locked
      
      v3.
          set errno to display->last_error
      
          check for the error only in wl_display_read_events. It's sufficient
          as prevention for the hanging and programmer doesn't need to
          check if wl_display_prepare_read (that was previously covered by
          this patch too) returned an error or the queue just was not empty.
          Without the check, it could result in indefinite looping.
      
      Thanks to Pekka Paalanen <pekka.paalanen@collabora.co.uk> for
      constant reviewing and discussing this patch.
      
      Signed-off-by: default avatarMarek Chalupa <mchqwerty@gmail.com>
      Reviewed-by: default avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
      8c061d1b
    • Marek Chalupa's avatar
      client: broadcast the right pthread_cond variable · 574b710e
      Marek Chalupa authored and Pekka Paalanen's avatar Pekka Paalanen committed
      
      In previous commit we removed unused variables. One of them was
      pthread_cond_t that was formerly used when reading from display, but
      later was (erroneously) made unused. This patch fixes this error
      and is a fix for the failing test introduced few patches ago (tests:
      test if thread can block on error)
      
      Reviewed-by: default avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
      574b710e
    • Olivier Blin's avatar
      client: drop unused event queue cond and list variables · 0cb9862c
      Olivier Blin authored and Pekka Paalanen's avatar Pekka Paalanen committed
      
      The wl_event_queue cond variable has been replaced by the wl_display
      reader_cond variable (commit 3c7e8bfb).
      This cond variable is never waited for anymore, just
      signaled/broadcasted, and thus can be safely removed.
      
      The wl_display event_queue_list and link from wl_event_queue
      can be removed as well, since it was only used to iterate over
      the event queue list in order to broadcast the now unused cond.
      
      No regression on queue unit tests.
      
      Signed-off-by: default avatarOlivier Blin <olivier.blin@softathome.com>
      
      v2: fixed and rebased after 886b09c9
          added signed-off-by
      
      v3: removed link from wl_event_queue
      
      Signed-off-by: default avatarMarek Chalupa <mchqwerty@gmail.com>
      Reviewed-by: default avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
      0cb9862c
    • Marek Chalupa's avatar
      tests: add test for reading after an error occurred · 71141288
      Marek Chalupa authored and Pekka Paalanen's avatar Pekka Paalanen committed
      
      This test shows that it's possible to successfully call wl_display_prepare_read
      and wl_display_read_events after an error occurred. That may lead to
      deadlock.
      
      When you call prepare read from two threads and then call read_events,
      one thread gets sleeping. The call from the other thread will return -1 and invokes
      display_fatal_error, but since
      we have display->last_error already set, the broadcast is not called and
      the sleeping thread sleeps indefinitely.
      
      Reviewed-by: default avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
      71141288
    • Marek Chalupa's avatar
      tests: add tests for wl_display_cancel_read · 213366e6
      Marek Chalupa authored and Pekka Paalanen's avatar Pekka Paalanen committed
      
      Test if wl_display_cancel_read wakes up other threads.
      
      Reviewed-by: default avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
      213366e6
    • Marek Chalupa's avatar
      tests: test if thread can block on error · 171e0bda
      Marek Chalupa authored and Pekka Paalanen's avatar Pekka Paalanen committed
      
      wl_display_read_events() can make a thread wait until some other thread
      ends reading. Normally it wakes up all threads after the reading is
      done. But there's a place when it does not get to waking up the threads
      - when an error occurs. This test reveals bug that can block programs.
      
      If a thread is waiting in wl_display_read_events() and another thread
      calls wl_display_read_events and the reading fails,
      then the sleeping thread is not woken up. This is because
      display_handle_error is using old pthread_cond instead of new
      display->reader_cond, that was added along with wl_display_read_events().
      
      Reviewed-by: default avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
      171e0bda
    • Marek Chalupa's avatar
      tests: test posting errors · 47208d2a
      Marek Chalupa authored and Pekka Paalanen's avatar Pekka Paalanen committed
      
      Test posting errors to one and more clients.
      
      Reviewed-by: default avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
      47208d2a
    • Marek Chalupa's avatar
      tests: use test compositor in queue-test · 93e65406
      Marek Chalupa authored and Pekka Paalanen's avatar Pekka Paalanen committed
      
      Most of the code of the queue-test is covered by the test compositor,
      so we can save few lines and use the test compositor instead.
      I think it's also more readable.
      
      This patch removes timeout from the test. We plan to add timeout
      to all tests later, though.
      
      v2.
        rebased to master
      
      Signed-off-by: default avatarMarek Chalupa <mchqwerty@gmail.com>
      Reviewed-by: default avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
      93e65406
    • Marek Chalupa's avatar
      tests: add test-compositor · 85d08e8b
      Marek Chalupa authored and Pekka Paalanen's avatar Pekka Paalanen committed
      
      This patch introduces a set of functions that can create a display
      and clients for tests.
      On server side the user can use functions:
        display_create()
        display_destroy()
        create_client()
        display_run()
        display_resume()
      and on client side the user can use:
        client_connect()
        client_disconnect()
        stop_display()
      
      The stop_display() and display_resume() are functions that serve as a barrier
      and also allow the display to take some action after the display_run() was called,
      because after the display is stopped, it can run arbitrary code until it calls
      display_resume().
      
      client_connect() function connects to wayland display and creates a proxy to
      test_compositor global object, so it can ask for stopping the display later
      using stop_display().
      
      An example:
      
        void
        client_main()
        {
              /* or client can use wl_display_connect(NULL)
               * and do all the stuff manually */
              struct client *c = client_connect();
      
              /* do some stuff, ... */
      
              /* stop the display so that it can
               * do some other stuff */
              stop_display(c, 1);
      
              /* ... */
      
              client_disconnect(c);
        }
      
        TEST(dummy_tst)
        {
             struct display *d = display_create();
      
             /* set up the display */
             wl_global_create(d->wl_display, ...);
      
             /* ... */
      
             create_client(d, client_main);
             display_run();
      
             /* if we are here, the display has been stopped
              * and we can do some code, i. e. create another global or so */
             wl_global_create(d->wl_display, ...);
      
             /* ... */
      
             display_resume(d); /* resume display and clients */
      
             display_destroy(d);
        }
      
      v2:
        added/changed message in few asserts that were not clear
        fixed codying style issues and typo
        client_create_with_name: fixed a condition in an assert
        get_socket_name: use also pid
        check_error: fix errno -> err
      
      [Pekka Paalanen: added test-compositor.h to SOURCES, added
      WL_HIDE_DEPRECATED to get rid of deprecated defs and lots of warnings,
      fixed one unchecked return value from write().]
      
      Signed-off-by: default avatarMarek Chalupa <mchqwerty@gmail.com>
      Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
      85d08e8b
  12. Aug 21, 2014
Loading