summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
cec4dea)
This is to wait for the reading thread to stop using the file object
while cleaning up.
Signed-off-by: Keith Packard <keithp@keithp.com>
return BT_PORT_DEFAULT;
}
return BT_PORT_DEFAULT;
}
PUBLIC void
altos_free(struct altos_file *file)
{
int i;
altos_close(file);
PUBLIC void
altos_free(struct altos_file *file)
{
int i;
altos_close(file);
- for (i = 0; i < 10 && file->busy; i++) {
- struct timespec delay = { .tv_sec = 1, .tv_nsec = 0 };
- nanosleep(&delay, NULL);
- }
+ for (i = 0; i < 10 && file->busy; i++)
+ altos_pause_one_second();
+#include <time.h>
+
+void
+altos_pause_one_second(void)
+{
+ struct timespec delay = { .tv_sec = 1, .tv_nsec = 0 };
+ nanosleep(&delay, NULL);
+}
int
altos_bt_port(struct altos_bt_device *device);
int
altos_bt_port(struct altos_bt_device *device);
+void
+altos_pause_one_second(void);
+
#endif /* _LIBALTOS_PRIVATE_H_ */
#endif /* _LIBALTOS_PRIVATE_H_ */
+
+void
+altos_pause_one_second(void)
+{
+ Sleep(1000);
+}