
@rtfpessoa@infosec.exchange // Open Source Enthusiast // Music Lover // Creator of https://teapawt.net/t.co/Pufhbq9KsJ // SEng Building Security Products @ Datadog
- Tweets2.7K
- Following395
- Followers310
- Likes2.4K

ALT Java 21 Schedule 2023/06/08 Rampdown Phase One (fork from main line) 2023/07/20 Rampdown Phase Two 2023/08/10 Initial Release Candidate 2023/08/24 Final Release Candidate 2023/09/19 General Availability Java 21 Features 404: Generational Shenandoah (Experimental) 430: String Templates (Preview) 431: Sequenced Collections 439: Generational ZGC 440: Record Patterns 441: Pattern Matching for switch 442: Foreign Function & Memory API (Third Preview) 443: Unnamed Patterns and Variables (Preview) 444: Virtual Threads 445: Unnamed Classes and Instance Main Methods (Preview) 446: Scoped Values (Preview) 448: Vector API (Sixth Incubator) 449: Deprecate the Windows 32-bit x86 Port for Removal 451: Prepare to Disallow the Dynamic Loading of Agents 452: Key Encapsulation Mechanism API 453: Structured Concurrency (Preview)
![let mut a = vec![1, 2, 3]; let mut x = 0; std::thread::scope(|s| { s.spawn(|| { println!("hello from the first scoped thread"); // We can borrow `a` here. dbg!(&a); }); s.spawn(|| { println!("hello from the second scoped thread"); // We can even mutably borrow `x` here, // because no other threads are using it. x += a[0] + a[2]; }); println!("hello from the main thread"); }); // After the scope, we can modify and access our variables again: a.push(4); assert_eq!(x, a.len());](https://pbs.twimg.com/media/FVjm5QjXoAEESKq.jpg?name=small&format=webp)
ALT let mut a = vec![1, 2, 3]; let mut x = 0; std::thread::scope(|s| { s.spawn(|| { println!("hello from the first scoped thread"); // We can borrow `a` here. dbg!(&a); }); s.spawn(|| { println!("hello from the second scoped thread"); // We can even mutably borrow `x` here, // because no other threads are using it. x += a[0] + a[2]; }); println!("hello from the main thread"); }); // After the scope, we can modify and access our variables again: a.push(4); assert_eq!(x, a.len());

























