Ejemplo n.º 1
0
UdevContext UdevDevice::getContext(void)
	{
	/* Get the udev context and reference it: */
	udev* context=udev_device_get_udev(device);
	udev_ref(context);
	
	/* Return a context object: */
	return UdevContext(context);
	}
Ejemplo n.º 2
0
UdevContext UdevMonitor::getContext(void)
	{
	/* Get the context and reference it: */
	udev* context=udev_monitor_get_udev(monitor);
	udev_ref(context);
	
	/* Return a context object: */
	return UdevContext(context);
	}
Ejemplo n.º 3
0
UdevContext
UdevContext::NewRef()
{
  {
    ScopeLock protect(udev_context_mutex);
    if (nullptr == udev_root_context) {
      udev_root_context = new UdevContext(udev_new());
      assert(udev_root_context);
    }
  }

  return UdevContext(*udev_root_context);
}