Go to Post All tools are powered by magic angry noise. - artdutra04 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Spotlight this post!  
Unread 04-03-2016, 00:11
Maxwell777's Avatar
Maxwell777 Maxwell777 is offline
Is allowed to touch stuff now
AKA: Jackson Gray
FRC #0842 (Falcon Robotics)
Team Role: Programmer
 
Join Date: Aug 2013
Rookie Year: 2014
Location: Phoenix, AZ
Posts: 72
Maxwell777 has a spectacular aura aboutMaxwell777 has a spectacular aura aboutMaxwell777 has a spectacular aura about
Re: Analog Gyro .getAngle() function occasionally giving massive random values

Quote:
Originally Posted by Peter Johnson View Post
Java AnalogGyro.getAngle() is indeed NOT thread-safe as currently written. If you are calling it from multiple threads with no locking protection you can get corrupted results. I'll get a patch submitted that adds "synchronized" to the various AnalogGyro methods, but in the meantime you can add locking yourself around all calls to AnalogGyro and see if that fixes the problem for you.
Thanks! I'll try that out. I figured that .getAngle() was thread safe because it returned a primitive type and I didn't think that there was anything too crazy running in the background. Do you know if any other common wpilib stuff that isn't thread safe? I might start going around and locking everything I can lol
__________________
But why?
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 12:42.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi