* Removed extra snooze() for debugging purposes when publishing a device; this
directly reduces the time the mouse cursor is visible but cannot be moved yet. Based on a patch by Adek336 as part of ticket #917. * Decreased the republishing snooze about a second, too. * Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42198 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -8,33 +8,36 @@
|
|||||||
* Marcus Overhagen ([email protected])
|
* Marcus Overhagen ([email protected])
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "ps2_service.h"
|
#include "ps2_service.h"
|
||||||
|
|
||||||
#include "packet_buffer.h"
|
#include "packet_buffer.h"
|
||||||
|
|
||||||
#define DEBUG_PUBLISHING
|
|
||||||
|
|
||||||
|
#define DEBUG_PUBLISHING
|
||||||
#ifdef DEBUG_PUBLISHING
|
#ifdef DEBUG_PUBLISHING
|
||||||
#include <debug.h>
|
# include <stdlib.h>
|
||||||
#include <stdlib.h>
|
# include <debug.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint32 id;
|
||||||
|
ps2_dev * dev;
|
||||||
|
} ps2_service_cmd;
|
||||||
|
|
||||||
|
enum {
|
||||||
|
PS2_SERVICE_NOTIFY_DEVICE_ADDED = 1,
|
||||||
|
PS2_SERVICE_NOTIFY_DEVICE_REPUBLISH,
|
||||||
|
PS2_SERVICE_NOTIFY_DEVICE_REMOVED,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
static sem_id sServiceSem;
|
static sem_id sServiceSem;
|
||||||
static thread_id sServiceThread;
|
static thread_id sServiceThread;
|
||||||
static volatile bool sServiceTerminate;
|
static volatile bool sServiceTerminate;
|
||||||
static packet_buffer * sServiceCmdBuffer;
|
static packet_buffer * sServiceCmdBuffer;
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
uint32 id;
|
|
||||||
ps2_dev * dev;
|
|
||||||
} ps2_service_cmd;
|
|
||||||
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
PS2_SERVICE_NOTIFY_DEVICE_ADDED = 1,
|
|
||||||
PS2_SERVICE_NOTIFY_DEVICE_REPUBLISH,
|
|
||||||
PS2_SERVICE_NOTIFY_DEVICE_REMOVED,
|
|
||||||
};
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ps2_service_notify_device_added(ps2_dev *dev)
|
ps2_service_notify_device_added(ps2_dev *dev)
|
||||||
@@ -104,7 +107,6 @@ ps2_service_thread(void *arg)
|
|||||||
packet_buffer_read(sServiceCmdBuffer, (uint8 *)&cmd, sizeof(cmd));
|
packet_buffer_read(sServiceCmdBuffer, (uint8 *)&cmd, sizeof(cmd));
|
||||||
switch (cmd.id) {
|
switch (cmd.id) {
|
||||||
case PS2_SERVICE_NOTIFY_DEVICE_ADDED:
|
case PS2_SERVICE_NOTIFY_DEVICE_ADDED:
|
||||||
snooze(1000000); // for better testing of possible input server race condition
|
|
||||||
TRACE("ps2: PS2_SERVICE_NOTIFY_DEVICE_ADDED %s\n", cmd.dev->name);
|
TRACE("ps2: PS2_SERVICE_NOTIFY_DEVICE_ADDED %s\n", cmd.dev->name);
|
||||||
ps2_dev_publish(cmd.dev);
|
ps2_dev_publish(cmd.dev);
|
||||||
break;
|
break;
|
||||||
@@ -112,7 +114,7 @@ ps2_service_thread(void *arg)
|
|||||||
case PS2_SERVICE_NOTIFY_DEVICE_REPUBLISH:
|
case PS2_SERVICE_NOTIFY_DEVICE_REPUBLISH:
|
||||||
TRACE("ps2: PS2_SERVICE_NOTIFY_DEVICE_REPUBLISH %s\n", cmd.dev->name);
|
TRACE("ps2: PS2_SERVICE_NOTIFY_DEVICE_REPUBLISH %s\n", cmd.dev->name);
|
||||||
ps2_dev_unpublish(cmd.dev);
|
ps2_dev_unpublish(cmd.dev);
|
||||||
snooze(2500000);
|
snooze(1500000);
|
||||||
ps2_dev_publish(cmd.dev);
|
ps2_dev_publish(cmd.dev);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user