SQ50 patches for libsigrok
Go to file
Alexandru Gagniuc 33c6e4c5a4 session: Make sr_session_stop thread-safe
With the sigrok session running in a worker thread, if sr_session_stop is called
from another thread, it shuts down the pollfds used by the hardware drivers,
without ensuring that the sigrok event loop is no longer using those pollfds.

On the demo driver, this involves shutting down the GIOChannels, causing a
segfault when the sigrok event loop tries to use them. This is evident when
using the Stop button in PulseView, while the session is running.

This isn't a problem with just the demo driver; any driver's resources may be
freed by sr_session_stop concurrently with the sigrok session running.

To solve this problem, we don't touch the session itself in sr_session_stop().
Instead, we mark it for decommissioning and return. The session polls this flag,
and shuts itself down when requested.

This fixes bug 4.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2013-04-14 23:39:15 +02:00
contrib Add Rigol DS1052E/1102E VID:PID 2013-04-11 18:32:08 +02:00
hardware demo: Keep a pointer to dev_context in sr_dev_inst and vice-versa 2013-04-14 23:39:15 +02:00
input input/vcd: deprecate struct sr_rational 2013-04-11 18:32:07 +02:00
output output/vcd: Use selected probes, not lowest-numbered ones 2013-04-11 18:49:24 +02:00
tests unittests: Adapt to new GVariant system. 2013-04-12 17:59:38 +02:00
.gitignore ignore test leftovers 2013-04-14 16:44:49 +02:00
AUTHORS autotools: Don't use "foreign" option. 2013-03-17 13:15:56 +01:00
COPYING sr/srd: Move some files to their resp. dirs. 2011-12-30 11:14:05 +01:00
Doxyfile Doxygen: Exclude std.c and tests/*. 2013-04-06 19:29:13 +02:00
HACKING Add a testsuite for libsigrok. 2013-03-09 11:55:43 +01:00
Makefile.am Add initial README.devices file. 2013-03-14 19:49:33 +01:00
NEWS sr: fx2lafw: Add basic support for USBee DX and clones 2012-08-01 00:12:00 +04:00
README Bump glib requirement to >= 2.32.0. 2013-04-12 18:47:06 +02:00
README.devices Don't make README.devices executable. 2013-03-17 13:16:04 +01:00
autogen.sh autotools: Don't use "foreign" option. 2013-03-17 13:15:56 +01:00
backend.c sr_init(): Sanity-check input/output modules. 2013-03-10 18:27:19 +01:00
configure.ac Bump glib requirement to >= 2.32.0. 2013-04-12 18:47:06 +02:00
device.c Adjust to GVariant-based sr_config_* functions 2013-04-11 18:32:06 +02:00
error.c Doxygen: Add @file items for the relevant files. 2012-10-22 11:56:18 +02:00
filter.c Doxygen: Fix a few warnings. 2013-04-06 19:25:23 +02:00
hwdriver.c use driver callbacks directly 2013-04-11 18:32:08 +02:00
libsigrok-internal.h session: Make sr_session_stop thread-safe 2013-04-14 23:39:15 +02:00
libsigrok.h session: Make sr_session_stop thread-safe 2013-04-14 23:39:15 +02:00
libsigrok.pc.in sr: SR_PACKAGE_VERSION_* for consistency. 2012-03-31 11:35:47 +02:00
log.c Doxygen: Add @file items for the relevant files. 2012-10-22 11:56:18 +02:00
proto.h sr_voltage_string(): deprecate struct sr_rational 2013-04-11 18:32:07 +02:00
session.c session: Make sr_session_stop thread-safe 2013-04-14 23:39:15 +02:00
session_driver.c Adjust to GVariant-based sr_config_* functions 2013-04-11 18:32:06 +02:00
session_file.c Adjust to GVariant-based sr_config_* functions 2013-04-11 18:32:06 +02:00
std.c Add/use std_hw_dev_acquisition_stop_serial(). 2013-02-08 23:32:45 +01:00
strutil.c sr_voltage_string(): deprecate struct sr_rational 2013-04-11 18:32:07 +02:00
version.c Doxygen: Properly document and handle version.h. 2013-04-06 19:25:29 +02:00
version.h.in Doxygen: Properly document and handle version.h. 2013-04-06 19:25:29 +02:00

README

-------------------------------------------------------------------------------
README
-------------------------------------------------------------------------------

The sigrok project aims at creating a portable, cross-platform,
Free/Libre/Open-Source signal analysis software suite that supports various
device types (such as logic analyzers, oscilloscopes, multimeters, and more).

libsigrok is a shared library written in C which provides the basic API
for talking to hardware and reading/writing the acquired data into various
input/output file formats.


Status
------

libsigrok is in a usable state and has had official tarball releases.

While the API can change from release to release, this will always be
properly documented and reflected in the package version number and
in the shared library / libtool / .so-file version numbers.

However, there are _NO_ guarantees at all for stable APIs in git snapshots!
Distro packagers should only use released tarballs (no git snapshots).


Requirements
------------

 - git
 - gcc (>= 4.0)
 - make
 - autoconf >= 2.63
 - automake >= 1.11
 - libtool
 - pkg-config >= 0.22
 - libglib >= 2.32.0
 - libzip >= 0.8
 - libusb-1.0 >= 1.0.9 (optional, used by most drivers)
 - libftdi >= 0.16 (optional, used by some drivers)
 - libudev >= 151 (optional, used by some drivers)
 - libasound / alsa-lib >= 1.0 (optional, only used by the alsa driver)
 - check >= 0.9.4 (optional, only needed to run unit tests)


Building and installing
-----------------------

In order to get the libsigrok source code and build it, run:

 $ git clone git://sigrok.org/libsigrok
 $ cd libsigrok
 $ ./autogen.sh
 $ ./configure
 $ make

For installing libsigrok:

 $ make install

See INSTALL or the following wiki page for more (OS-specific) instructions:

 http://sigrok.org/wiki/Building


Device-specific issues
----------------------

Please check README.devices for some notes and hints about device- or
driver-specific issues to be aware of.


Firmware
--------

Some devices supported by libsigrok need a firmware to be uploaded before the
device can be used. See README.devices for details.


Mailing lists
-------------

There are two mailing lists for sigrok/libsigrok:

 https://lists.sourceforge.net/lists/listinfo/sigrok-devel
 https://lists.sourceforge.net/lists/listinfo/sigrok-commits


IRC
---

You can find the sigrok developers in the #sigrok IRC channel on Freenode.


Website
-------

 http://sigrok.org/wiki/Libsigrok