Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NuttX RTOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
f4grx
NuttX RTOS
Commits
b584ecb9
Commit
b584ecb9
authored
10 years ago
by
Gregory Nutt
Browse files
Options
Downloads
Patches
Plain Diff
CC3000: Fix a race condition in start-up of unsoliced_thread. From Jussi Kivilinna
parent
b2d26436
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
drivers/wireless/cc3000/cc3000drv.c
+12
-0
12 additions, 0 deletions
drivers/wireless/cc3000/cc3000drv.c
with
12 additions
and
0 deletions
drivers/wireless/cc3000/cc3000drv.c
+
12
−
0
View file @
b584ecb9
...
...
@@ -90,6 +90,7 @@ static struct
cc3000_buffer_desc
rx_buffer
;
mqd_t
queue
;
sem_t
*
done
;
sem_t
unsoliced_thread_wakesem
;
}
spiconf
;
/*****************************************************************************
...
...
@@ -209,6 +210,8 @@ static void *unsoliced_thread_func(void *parameter)
spiconf
.
done
=
sem_open
(
buff
,
O_RDONLY
);
DEBUGASSERT
(
spiconf
.
done
!=
(
sem_t
*
)
-
1
);
sem_post
(
&
spiconf
.
unsoliced_thread_wakesem
);
while
(
spiconf
.
run
)
{
memset
(
&
spiconf
.
rx_buffer
,
0
,
sizeof
(
spiconf
.
rx_buffer
));
...
...
@@ -255,6 +258,8 @@ void cc3000_open(gcSpiHandleRx pfRxHandler)
spiconf
.
cc3000fd
=
fd
;
spiconf
.
run
=
true
;
sem_init
(
&
spiconf
.
unsoliced_thread_wakesem
,
0
,
0
);
pthread_attr_t
attr
;
struct
sched_param
param
;
pthread_attr_init
(
&
attr
);
...
...
@@ -265,6 +270,13 @@ void cc3000_open(gcSpiHandleRx pfRxHandler)
unsoliced_thread_func
,
NULL
);
DEBUGASSERT
(
status
==
0
)
UNUSED
(
status
);
/* Wait unsoliced_thread to wake-up. */
while
(
sem_wait
(
&
spiconf
.
unsoliced_thread_wakesem
)
!=
0
)
{
ASSERT
(
errno
==
EINTR
);
}
}
DEBUGASSERT
(
spiconf
.
cc3000fd
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment